Skip to content

Instantly share code, notes, and snippets.

@quellish
Created November 15, 2014 19:28
Show Gist options
  • Select an option

  • Save quellish/6cf0e30f17d3a522a3d0 to your computer and use it in GitHub Desktop.

Select an option

Save quellish/6cf0e30f17d3a522a3d0 to your computer and use it in GitHub Desktop.
presentError
- (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