Neither connectionDidFinishLoading: nor didFailWithError: get invoked

Call

connectionInProgress = [[NSURLConnection alloc] initWithRequest:request delegate:self startImmediately:YES];

when I disconnect and connect the Internet to the simulator. One call to initWithRequest: calls neither connectionDidFinishLoading:, nor calls didFailWithError:.

I call in a loop and get the following results (when disconnected).

Error DidFailWithError: Fetch: Offline Internet connection.

The next call in a few seconds (when reconnecting the Internet).

DidFailWithError: Fetch failed: A server with the specified host name could not be found.

And the next time I call neither of the two callbacks, it gets called.

+3
source share
1 answer

I ran into the same issue with the iPhone simulator.

6 , googling stackoverflow : iPhone ! (, , , ).

Wi-Fi/- mac, , iPhone! ( , , Wi-Fi )

( NSURLConnection) iPhone 4, , makeFailWithError! !

, Xcode 4.0 iOS 4.3

, : iOS, , , !

+1

Source: https://habr.com/ru/post/1793154/


All Articles