Created
September 20, 2014 19:22
-
-
Save quellish/cb45944282d161d7ca78 to your computer and use it in GitHub Desktop.
Example of correct checking of connection errors in objective-c
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [NSURLConnection sendAsynchronousRequest:request queue:[self connectionQueue] completionHandler:^(NSURLResponse *response, NSData *data, NSError *connectionError) { | |
| if (response != nil){ | |
| /// Yay, we were able to connect! | |
| } else { | |
| [self presentError:connectionError]; | |
| } | |
| }]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment