Reputation: 205
Everything works fine, but sometimes uiwebview did not finish the load. I guess that sometimes uiwebview waits to long for response and than do not finish load. Had someone have familiar issue?
Yes, I have implemented the next methods:
- (void)webViewDidStartLoad:(UIWebView *)webView
- (void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error
- (void)webViewDidFinishLoad:(UIWebView *)webView
Yes, I setup the delegate. As I said - everything works fine, but sometimes it do not finish to load, it do not receives any error.
- (void)myTimer:(NSTimer *)timer
{
NSLog(@"WV=%@ delegate=%@ isLoading=%d", self.webView, self.webView.delegate, self.webView.isLoading);
}
It prints all the time:
[378:c07] WV=UIWebView: 0x755f690; frame = (0 0; 320 416); autoresize = W+H; layer = CALayer: 0x755f6f0>> delegate=MainViewController: 0x755b130> isLoading=1;
I also tried to setup cache policy and disable it. It didn't help. Can it be the problem with html frame? When it is loading some elements from the webpage are disappear (it happens when webpage is loaded, but usually after elements disappeared it shows a new page, but in this case it is not).
Upvotes: 0
Views: 2181
Reputation: 41632
Did you implement didFailLoadWithError:
? Implement all the delegate methods, and log various ones, and see what happens - if it just stalls or something happens before it appears to stall.
EDIT: So use a schedule NSTimer that fires every few seconds, and log the following:
loading
propertyHere ist the code:
- (void)myTimer:(NSTimer *)timer
{
NSLog(@"WV=%@ delegate=%@ isLoading=%d", self.webView, self.webView.delegate, self.webView.isLoading);
}
Let it run for at least 10 minutes (go out and get coffee), then report back here. If it prints out all the info for a long time (like 10 min), then if you can post the URL here that would be a big help, so others can try to duplicate the problem.
Upvotes: 2