void SendDelegateMessage(NSInvocation *): delegate (webView:decidePolicyForNavigationAction:request:frame:decisionListener:) failed to return after waiting 10 seconds. main run loop mode: kCFRunLoopDefaultMode
解决办法如下:
- (void) viewDidDisappear:(BOOL)animated
{
[superviewDidDisappear:animated];
// [self.webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"about:blank"]]];
[self.webView loadHTMLString:@" " baseURL:nil];
}
//清楚webview的缓存时要使用 [self.webView loadHTMLString:@" " baseURL:nil];
使用[self.webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"about:blank"]]];这个方法清除webview内容时仍会发起网络请求,这个下面的方法就没用了,因为时异步请求。
- (void)dealloc
{
self.webView.delegate=nil;
[self.webView stopLoading];
}
网友评论