美文网首页
崩溃:Terminating app due to uncaug

崩溃:Terminating app due to uncaug

作者: 西西可西 | 来源:发表于2017-07-10 11:28 被阅读27次

1.先说一下我的场景吧,在请求麦克风权限的时候,用户点击"是","否",在相应的block里面做处理,调起我的UIView动画,present一个ViewController时,在iPhone7 plus上崩溃,崩溃信息Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'accessing _cachedSystemAnimationFence requires the main thread 代码如下:

崩溃代码

分析:在if (granted)中,是在子线程中执行的,如果需要在判断语句里面调用界面操作,需要修改如下:

修改后的代码

如果需要操作界面的话,需要回到主线程。


相关文章

网友评论

      本文标题:崩溃:Terminating app due to uncaug

      本文链接:https://www.haomeiwen.com/subject/xreyhxtx.html