philip
philip

Reputation: 37

detect connection problem in NSUrlConnection

I have a class that implements the delegate NSUrlConnection, from connection didFailWithError. How can I detect an error caused when there is no Internet connection?

Upvotes: 0

Views: 362

Answers (1)

alfred
alfred

Reputation: 217

According to my memory, the error code of the missing Internet connection is -1009. In method

-(void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error 

try checking [error code]

Upvotes: 2

Related Questions