2010-02-23 84 views
0

我在我的应用程序中使用了UIWebview,当出现错误时,它显示一条警告消息。UIWebView警报不显示页面URL?

消息正常,但警报消息的标题显示页面URL,但这并不起作用。

无论如何摆脱这一点,并显示一个自定义文本呢?

感谢您的帮助。

回答

0

请看执行UIWebViewDelegate protocoll的情况,其中 - (void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error被定义。在那里你应该设置一个UIAlertView- (id)initWithTitle:(NSString *)title message:(NSString *)message delegate:(id)delegate cancelButtonTitle:(NSString *)cancelButtonTitle otherButtonTitles:(NSString *)otherButtonTitles

+0

感谢您的回复。但是,我不在寻找加载错误。我想显示一条消息,不一定是错误。 – Prasanna 2010-02-24 05:05:47

+0

UIWebViewDelegate还有其他几种在加载webview之前或之后进行反应的方法。这可能会帮助你。 – AlexVogel 2010-02-24 09:34:02