*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'accessing _cachedSystemAnimationFence requires the main thread'*** First throw call stack:

适配iOS10遇到的问题的,我调试了很久!网上找了很久说是原因是冒号没写才导致的错误,望大家细心点。看到这个我就懵逼了,这怎么找,没办法,把这模块抽出来发现还是这个问题,最后还是在主线程上更新解决了这个问题!
2016-09-27 13:43:56.008369 FPHClient[585:81534] This application is modifying the autolayout engine from a background thread after the engine was accessed from the main thread. This can lead to engine corruption and weird crashes. Stack:(0 CoreFoundation 0x0000000187be01d8 + 1481 libobjc.A.dylib 0x000000018661855c objc_exception_throw + 562 CoreFoundation 0x0000000187be0108 + 03 Foundation 0x00000001887c4f0c + 1924 Foundation 0x00000001887c4c4c + 765 Foundation 0x00000001886105dc + 1126 Foundation 0x00000001887c38e8 + 1127 UIKit 0x000000018da26738 + 16888 QuartzCore 0x000000018aeee40c + 1489 QuartzCore 0x000000018aee30e8 + 29210 UIKit 0x000000018da3afbc + 102011 UIKit 0x000000018e3fae9c + 10812 UIKit 0x000000018e4018cc + 8013 UIKit2016-09-27 13:43:56.009094 FPHClient[585:81534] *** Assertion failure in -[UIApplication _cachedSystemAnimationFenceCreatingIfNecessary:], /BuildRoot/Library/Caches/com.apple.xbs/Sources/UIKit/UIKit-3599.6.1/UIApplication.m:17042016-09-27 13:43:56.017873 FPHClient[585:81142] invalid mode 'kCFRunLoopCommonModes' provided to CFRunLoopRunSpecific - break on _CFRunLoopError_RunCalledWithInvalidMode to debug. This message will only appear once per execution.2016-09-27 13:43:57.038278 FPHClient[585:81142] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'accessing _cachedSystemAnimationFence requires the main thread'* First throw call stack:(0x187be01c0 0x18661855c 0x187be0094 0x18866a82c 0x18dcaa768 0x18dd01874 0x18daf74ac 0x18e4007b0 0x18e40780c 0x18e3fc4cc 0x18e407360 0x18e3ffe7c 0x18daeff78 0x18e12765c 0x18daed7f0 0x18daec990 0x18dae2b6c 0x18dae1c38 0x18dae17ec 0x18dae1750 0x18da2654c 0x18aeee40c 0x18aee30e8 0x18aee2fa8 0x18ae5fc64 0x18ae870d0 0x18ae87af0 0x187b8d7dc 0x187b8b40c 0x187aba068 0x18c65ba2c 0x186c73860 0x186c73770 0x186c70dbc)libc++abi.dylib: terminating with uncaught exception of type NSException**
**(lldb) **


解决办法:

原因是冒号没写才导致的错误,望大家细心点。、

//在主线程更新UI操作

    dispatch_async(dispatch_get_main_queue(), ^{            //更新UI操作 //.....            [weakSelf.navigationController popViewControllerAnimated:NO]; 
    });

PS:来混,关注是必须的,点赞❤️ 是要给的!

你可能感兴趣的:(*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'accessing _cachedSystemAnimationFence requires the main thread'*** First throw call stack:)