UIWebView alert not display page URL?
I am using a UIWebview in my app, and when there is an error, it displays 开发者_StackOverflow中文版an alert message.
The message is fine, but the title of the alert message displays the page URL, which doesn't help.
Anyway to get rid of that and display a custom text instead?
Thanks for your help.
Please look at the implementation of the UIWebViewDelegate
protocoll where
- (void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error
is defined. There you should set an UIAlertView
with - (id)initWithTitle:(NSString *)title message:(NSString *)message delegate:(id)delegate cancelButtonTitle:(NSString *)cancelButtonTitle otherButtonTitles:(NSString *)otherButtonTitles
.
精彩评论