Display a message when navigation failed

- alert is shown with error description
- address panel text changed
- spinner stopped
This commit is contained in:
Tomáš Fejfar
2012-01-11 15:00:18 +01:00
parent de1445ed38
commit 49ebfcdeae

View File

@@ -219,5 +219,21 @@
}
- (void)webView:(UIWebView *)wv didFailLoadWithError:(NSError *)error {
NSLog (@"webView:didFailLoadWithError");
[spinner stopAnimating];
addressLabel.text = @"Failed";
if (error != NULL) {
UIAlertView *errorAlert = [[UIAlertView alloc]
initWithTitle: [error localizedDescription]
message: [error localizedFailureReason]
delegate:nil
cancelButtonTitle:@"OK"
otherButtonTitles:nil];
[errorAlert show];
[errorAlert release];
}
}
@end