开发者

UIWebView alert not display page URL?

开发者 https://www.devze.com 2022-12-20 20:14 出处:网络
I am using a UIWebview in my app, and when there is an error, it displays 开发者_StackOverflow中文版an alert message.

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号