views:

191

answers:

1

I am using a UIWebview in my app, and when there is an error, it displays 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.

A: 

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.

AlexVogel
Thanks for your reply. But, I am not looking for loading error. I would like display a message, not necessarily an error.
Prasanna
There are several other methods in UIWebViewDelegate for reactiing before or after loading a webview. This may help you.
AlexVogel