ios – UIWebview:WebThread EXC_BAD_ACCESS

我有一个完全简单的应用程序:使用 http://tv2.dk显示Web视图

我正在使用故事板,添加了Web视图并在我的控制器上设置了属性.为了简单起见,我没有设置代表.

在viewDidLoad中,我使用我想要加载的URL调用Web视图

[self.webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://tv2.dk"]]];

每次应用程序启动时,由于Web线程工作程序中的某些错误而导致崩溃,请参阅此转储.

libobjc.A.dylib`objc_msgSend:
0x1954f7bc0:  cmp    x0,#0
0x1954f7bc4:  b.le   0x1954f7c30               ; objc_msgSend + 112
0x1954f7bc8:  ldr    x13,[x0]
0x1954f7bcc:  and    x9,x13,#0x1fffffff8
0x1954f7bd0:  ldp    x10,x11,[x9,#16]
0x1954f7bd4:  and    w12,w1,w11
0x1954f7bd8:  add    x12,x10,x12,lsl #4
0x1954f7bdc:  ldp    x16,x17,[x12]
0x1954f7be0:  cmp    x16,x1
0x1954f7be4:  b.ne   0x1954f7bec               ; objc_msgSend + 44
0x1954f7be8:  br     x17
0x1954f7bec:  cbz    x16,0x1954f7d80          ; _objc_msgSend_uncached_impcache
0x1954f7bf0:  cmp    x12,x10
0x1954f7bf4:  b.eq   0x1954f7c00               ; objc_msgSend + 64
0x1954f7bf8:  ldp    x16,[x12,#-16]!
0x1954f7bfc:  b      0x1954f7be0               ; objc_msgSend + 32
0x1954f7c00:  add    x12,w11,uxtw #4
0x1954f7c04:  ldp    x16,[x12]
0x1954f7c08:  cmp    x16,x1
0x1954f7c0c:  b.ne   0x1954f7c14               ; objc_msgSend + 84
0x1954f7c10:  br     x17
0x1954f7c14:  cbz    x16,0x1954f7d80          ; _objc_msgSend_uncached_impcache
0x1954f7c18:  cmp    x12,x10
0x1954f7c1c:  b.eq   0x1954f7c28               ; objc_msgSend + 104
0x1954f7c20:  ldp    x16,#-16]!
0x1954f7c24:  b      0x1954f7c08               ; objc_msgSend + 72
0x1954f7c28:  mov    x2,x9
0x1954f7c2c:  b      0x1954e1e70               ; objc_msgSend_corrupt_cache_error
0x1954f7c30:  b.eq   0x1954f7c48               ; objc_msgSend + 136
0x1954f7c34:  adrp   x10,18278
0x1954f7c38:  add    x10,#1904
0x1954f7c3c:  lsr    x11,x0,#60
0x1954f7c40:  ldr    x9,[x10,lsl #3]
0x1954f7c44:  b      0x1954f7bd0               ; objc_msgSend + 16
0x1954f7c48:  movz   x1,#0
0x1954f7c4c:  movi   d0,#0000000000000000
0x1954f7c50:  movi   d1,#0000000000000000
0x1954f7c54:  movi   d2,#0000000000000000
0x1954f7c58:  movi   d3,#0000000000000000
0x1954f7c5c:  ret

违规线

0x1954f7bd0:  ldp    x10,#16]

在这里查看完整的源代码:https://bitbucket.org/styrken/ios-webview-crash

我已经尝试在多个设备上运行此代码等,崩溃了.

解决方法

来自@RasmusStyrk上面的评论

I have found out that with using NSZombie’s,i got the following crash
message: WebviewCrash[4598:956679] *** -[UIViewAnimationState
release]: message sent to deallocated instance 0x1707c5370. To fix
this i had to turn off animations in UIVIew using [UIView
setAnimationsEnabled:NO]; and now it works. It seems like a bug in
iOS8. –

我们也有这个随机崩溃的地方,设置[UIView setAnimationsEnabled:NO]是唯一能够完全缓解这个问题的东西!

相关文章

当我们远离最新的 iOS 16 更新版本时,我们听到了困扰 Apple...
欧版/美版 特别说一下,美版选错了 可能会永久丧失4G,不过只...
一般在接外包的时候, 通常第三方需要安装你的app进行测...
前言为了让更多的人永远记住12月13日,各大厂都在这一天将应...