使用webview与native 应用做交互的时候出现警告

使用web view 与native 进行交互的时候 出现了 
如下警告:并且跳转会有延迟。
警告如下:
This application is modifying the autolayout engine from a background thread, which can lead to engine corruption and weird crashes.  This will cause an exception in a future release.
 Stack:(
0   CoreFoundation                      0x0000000181849918 <redacted> + 148
1   libobjc.A.dylib                     0x0000000180eb7f80 objc_exception_throw + 56
2   CoreFoundation                      0x0000000181849848 <redacted> + 0
3   Foundation                          0x00000001822e72d4 <redacted> + 88
4   Foundation                          0x000000018216d99c <redacted> + 56
5   Foundation                          0x0000000182174fb4 <redacted> + 1036
6   Foundation                          0x00000001821749d8 <redacted> + 240
7   UIKit                               0x0000000186646e90 <redacted> + 176
8   UIKit                               0x0000000186647384 <redacted> + 196
9   UIKit                               0x00000001866423f4 <redacted> + 268
10  UIKit                               0x0000000186598db0 <redacted> + 80
11  UIKit                               0x00000001865436c4 <redacted> + 572
12  UIKit                               0x00000001867d5ca4 <redacted> + 1384
13  UIKit                               0x000000018654a964 <redacted> + 80
14  UIKit                               0x0000000186735118 <redacted> + 260
15  UIKit                               0x0000000186850840 <redacted> + 220
16  UIKit                               0x0000000186734c90 <redacted> + 1060
17  UIKit                               0x00000001866ee6a0 <redacted> + 3544
18  UIKit                               0x00000001865fa9b8 <redacted> + 688
19  UIKit                               0x00000001865fa694 <redacted> + 60
20  UIKit                               0x00000001865fa5fc <redacted> + 208
21  UIKit                               0x0000000186537778 <redacted> + 656
22  QuartzCore                          0x0000000183f46b2c <redacted> + 148
23  QuartzCore                          0x0000000183f41738 <redacted> + 292
24  QuartzCore                          0x0000000183f415f8 <redacted> + 32
25  QuartzCore                          0x0000000183f40c94 <redacted> + 252
26  QuartzCore                          0x0000000183f409dc <redacted> + 512
27  QuartzCore                          0x0000000183f3a0cc <redacted> + 80
28  CoreFoundation                      0x0000000181800588 <redacted> + 32
29  CoreFoundation                      0x00000001817fe32c <redacted> + 372
30  CoreFoundation                      0x000000018172d6a0 CFRunLoopRunSpecific + 416
31  WebCore                             0x00000001852dd738 <redacted> + 456
32  libsystem_pthread.dylib             0x00000001814b3b28 <redacted> + 156
33  libsystem_pthread.dylib             0x00000001814b3a8c <redacted> + 0
34  libsystem_pthread.dylib             0x00000001814b1028 thread_start + 4
)

解决方案是: 进行跳转到原生页面 把这段代码加到主线程 然后就不会出现这种问题了。
It needs to be placed inside a different thread that allows the UI to update:
 dispatch_async(dispatch_get_main_queue(), ^{
       
// code here
    });

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值