Anyone able to help me out with this crash? It happens intermittently when switching back and forth between some UIWebView instances while they are loading.
The cra
I see that you have iOs 5.0. Are the files that you're loading Office documents (docx, xls)?
If so, then your case is the same as mine. This problem reproduces only on systems with 5.0 (iPad and iPad 2 here), and happens when you try to stop UIWebView
object before it finishes loading the file. Whether it's by calling stopLoading
or loadRequest
This doesn't happen with txt files.
And if it does, it originates in WebThread
starting from line:
#1 0x34912158 in -[QuickLookHandleAsDelegate connection:didReceiveData:lengthReceived:] ()
and jumping to some random pointers like:
#0 0x00000010 in 0x00000010 ()
Check that your UIWebViewDelegate delegate is still valid (ie. not released) if your UIWebView is in the background. This problem may be caused by the webview trying to call your delegate with
- (void)webViewDidFinishLoad:(UIWebView *)webView;
in the background after loading has completed.
To expand on @K1w1Geek's answer, the problem may be that the user is closing the web view just before it tries to send a delegate callback and it crashes because it doesn't exist. This doesn't necessarily have to be related to loading a particular document type because I'm experiencing this crash just navigating a Salesforce website.
So if you have a close button, try to stop loading and set the delegate to nil before closing:
- (IBAction)btnCloseWebviewTap:(id)sender{
[_webView stopLoading];
_webView.delegate = nil;
[self dismissViewControllerAnimated:YES completion:nil];
}