ios webview弹出崩溃

标签 ios uiwebview

任何人都知道当 webview 弹出时崩溃是什么,它有时会发生。

0 libobjc.A.dylib 0x0000000190c8ef30 objc_msgSend  (respondsToSelector:) + 16
1 CoreFoundation 0x0000000192248078 ____forwarding___ + 404
2 CoreFoundation 0x000000019214259c _CF_forwarding_prep_0 + 80
3 CoreFoundation 0x000000019224a160 ___invoking___ + 144
4 CoreFoundation 0x000000019213dc3c -[NSInvocation invoke] + 284
5 WebCore 0x0000000196cea200 HandleDelegateSource(void*) + 108
6 CoreFoundation 0x00000001921f2278 ___CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 24
7 CoreFoundation 0x00000001921f1bc0 ___CFRunLoopDoSources0 + 524
8 CoreFoundation 0x00000001921ef7c0 ___CFRunLoopRun + 804
9 CoreFoundation 0x000000019211e048 CFRunLoopRunSpecific + 436
10 GraphicsServices 0x0000000193ba1198 GSEventRunModal + 172
11 UIKit 0x00000001980f8628 -[UIApplication _run] + 684
12 UIKit 0x00000001980f3360 UIApplicationMain + 208
13 HuaYang 0x00000001007dc894 main (main.m:21)
14 libdyld.dylib 0x00000001911005b8 _dyld_process_info_notify_release + 36

最佳答案

objc_msgSend (respondsToSelector:) - This is a memory management issue. You will need to replicate the conditions of the crash with Zombies turned on and check once else another option stop loading the webView and remove the delegate before leaving the view:



objective-c
- (void)viewWillDisappear:(BOOL)animated{
    [yourwebViewname setDelegate:nil];
    [yourwebViewname stopLoading];
}

迅速
override func viewWillDisappear(_ animated: Bool) {
super.viewWillDisappear(animated)
yourwebViewname.delegate = nil
yourwebViewname.stopLoading()
}

关于ios webview弹出崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45809084/

相关文章:

ios - 提交 iOS 应用程序时,我可以使用 Facebook 应用程序页面作为支持 URL 吗?

ios - 当后台线程中的自动释放池释放对象时?

objective-c - 在 UIWebView (IOS 5) 中更改用户代理

ios - WKWebView 动态大小问题

ios - 如何从 UIWebView 下载文件并再次打开

ios - PFQuery - 如何获取 NSError?

ios - 如果它等于一个值,则删除表行

iphone - 从 HTML + UIWebView 下载视频

javascript - 获取 HTML 元素 - Obj-c

ios - 如何测试项目中的私有(private)或文件私有(private)函数