我想在UIWebview中加載URLRequest。在UIWebview中奇怪的加載
我嘗試了幾個URL。所有工作都很好。 但是在一個URL中,它表現得很奇怪。 當我導航到我的web視圖它花了很多時間來加載這個特定的URL。
[self.mediaWebView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:[@"http://www.whatmakesahighperformanceorganization.com" stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding ]]]];
而且它通知我加載和完成加載多次。
- (void)webViewDidStartLoad:(UIWebView *)webView {
NSLog(@"webViewDidStartLoad...");
[self.loadingActivityView setHidden:NO];
[self.loadingActivityView startAnimating];
}
- (void)webViewDidFinishLoad:(UIWebView *)webView {
NSLog(@"webViewDidFinishLoad...");
[self.loadingActivityView stopAnimating];
}
- (void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error
{
NSLog(@"Error=%@",error);
}
這是我在一個單一的呼叫
2012-06-19 15:25:54.255 MyApp[1957:707] webViewDidStartLoad...
2012-06-19 15:25:55.842 MyApp[1957:707] webViewDidStartLoad...
2012-06-19 15:25:55.893 MyApp[1957:707] webViewDidStartLoad...
2012-06-19 15:25:56.675 MyApp[1957:707] webViewDidFinishLoad…
2012-06-19 15:27:03.148 MyApp[1957:707] webViewDidStartLoad...
2012-06-19 15:27:09.336 MyApp[1957:707] webViewDidFinishLoad…
2012-06-19 15:27:52.661 MyApp[1957:707] webViewDidFinishLoad...
2012-06-19 15:27:52.683 MyApp[1957:707] webViewDidFinishLoad…
檢查URL可能有許多閃光的內容第4和第5