Created
November 15, 2014 19:28
-
-
Save quellish/6cf0e30f17d3a522a3d0 to your computer and use it in GitHub Desktop.
presentError
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
| - (void) presentError:(NSError *)error { | |
| if ([[error domain] isEqualToString:NSURLErrorDomain]){ | |
| NSURL *failingURL = [[error userInfo] valueForKey:NSURLErrorFailingURLErrorKey]; | |
| switch ([error code]){ | |
| case NSURLErrorInternationalRoamingOff: | |
| case NSURLErrorCallIsActive: | |
| NSURLErrorDataNotAllowed: | |
| case NSURLErrorNotConnectedToInternet: | |
| [self beginObservingReachabilityStatusForHost:[failingURL host]]; | |
| break; | |
| default: | |
| break; | |
| } | |
| } | |
| return; | |
| } | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment