This can be enlightening (if you have not gone so far) in NSLog, the boot trace starts and ends.
- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType { NSLog(@"Loading: %@", [request URL]); return YES; } - (void)webViewDidFinishLoad:(UIWebView *)webView { NSLog(@"didFinish: %@; stillLoading: %@", [[webView request]URL], (webView.loading?@"YES":@"NO")); } - (void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error { NSLog(@"didFail: %@; stillLoading: %@", [[webView request]URL], (webView.loading?@"YES":@"NO")); }
I just watched the calls to all three in one of my projects, which loads the help page from my package and contains built-in resources (external css, YUI !, images). The only request that comes up is loading the start page, shouldStartLoadWithRequest not called for any of the dependencies. So curious why your didFinishLoad is called multiple times.
Perhaps what you see is related to redirecting or, as already mentioned, ajax calls on the loaded page. But at least you should be able to equalize calls to shouldStartLoad and any of the other two delegate functions and be able to determine when the download will be completed.
wkw Dec 06 '09 at 12:26 2009-12-06 12:26
source share