Skip to content

Instantly share code, notes, and snippets.

@versluis
Created August 1, 2012 16:24
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save versluis/3228441 to your computer and use it in GitHub Desktop.
Save versluis/3228441 to your computer and use it in GitHub Desktop.
How to handle an error while loading a UIWebView
- (void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error {
[self.spinningWheel stopAnimating];
UIApplication *application = [UIApplication sharedApplication];
application.networkActivityIndicatorVisible = NO;
UIAlertView *infoMessage;
infoMessage = [[UIAlertView alloc]
initWithTitle:@"The internet is broken" message:@"Looks like there's a problem with your internet connection. Please check and try again later."
delegate:self cancelButtonTitle:@"Bloody technology!" otherButtonTitles:nil];
infoMessage.alertViewStyle = UIAlertViewStyleDefault;
[infoMessage show];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment