From Apple docs:
NSURLErrorCancelled (-999)
"Returned when the asynchronous download is canceled. The Web Kit framework divider will receive this error when performing the undo operation on the boot resource. Note that the NSURLConnection or NSURLDownload delegate will not receive this error if the download is canceled."
So, the most likely case for this is to load the request, and then another (or the same one), before the first one is completed. It can happen. for example, if you call loadRequest (or loadHTMLString ) in a method of type viewDidAppear: which can be called several times. This is also reported if you quickly touch 2 links in UIWebView .
So, the general suggestion is to look at how and where you call loadRequest (or loadHTMLString ), and perhaps provide some code.
To fix this problem, I would suggest adding the following traces to your web view delegate:
- (void)webViewDidStartLoad:(UIWebView *)webView { NSLog(@"Starting to download request: %@", [webView.request.URL absoluteString]); } - (void)webViewDidFinishLoad:(UIWebView *)webView { NSLog(@"Finished downloading request: %@", [webView.request.URL absoluteString]); } - (void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error { if ([error code] == NSURLErrorCancelled) NSLog(@"Canceled request: %@", [webView.request.URL absoluteString]); }
If you check the output, you should see more clearly what is happening. If you insert a result, we can try and help you.
source share