Aar*_*ron 29 iphone crash-reports uiwebview
我刚从iTunes Connect下载了我的一个iPhone应用程序的崩溃报告.最常见的崩溃有如下所示的痕迹:
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0xa1b1c1db
Crashed Thread: 0
Thread 0 Crashed:
0 libobjc.A.dylib 0x3030e6f4 objc_msgSend + 16
1 UIKit 0x30ebebee -[UIWebView webView:resource:didFinishLoadingFromDataSource:]
2 UIKit 0x30ebe5ca -[UIWebViewWebViewDelegate webView:resource:didFinishLoadingFromDataSource:]
3 CoreFoundation 0x32b73b5c __invoking___ + 60
4 CoreFoundation 0x32bc67be -[NSInvocation invoke]
5 WebCore 0x320baa86 HandleDelegateSource
6 CoreFoundation 0x32bb8a96 CFRunLoopRunSpecific
7 CoreFoundation 0x32bb8356 CFRunLoopRunInMode
8 GraphicsServices 0x30544cd4 GSEventRunModal
9 GraphicsServices 0x30544d80 GSEventRun
10 UIKit 0x30d2c768 -[UIApplication _run]
11 UIKit 0x30d2b46c UIApplicationMain
Run Code Online (Sandbox Code Playgroud)
我大约80%确定这是UIWebView内部的问题,超出了我能解决的范围.有没有人有任何关于如何缩小这个问题的建议,以帮助确定它是OS和UIWebView的问题,还是我可以在我的代码中修复和解决的问题?提前致谢.
更新:有问题的UIWebView在视图中,当用户点击相应导航控制器的后退按钮时,该视图将被释放.已接受的解决方案似乎为此错误发生的原因提供了一个很好的解释.
在建议解决之前:
- (void)dealloc {
[webView release];
[super dealloc];
}
Run Code Online (Sandbox Code Playgroud)
建议解决方案后:
- (void)dealloc {
webView.delegate = nil;
[webView stopLoading];
[webView release];
[super dealloc];
}
Run Code Online (Sandbox Code Playgroud)
Ste*_*ton 66
场景如下:
UIWebView
.作为代表的UIViewController
集合self
UIViewController
被取消分配UIWebView
完成加载并向其委托发送"我完成"消息...UIWebView
在解除分配委托之前,您需要停止加载其页面并将其委托设置为nil.
归档时间: |
|
查看次数: |
13787 次 |
最近记录: |