iOS 11出现的坑,Main Thread Checker: UI API called on a background thread: -[UIApplication statusBarOrien
2017-11-13 11:45
2266 查看
2017-11-13 11:39:04.348973+0800 PlantsAndFlowers[11262:2146383] [reports] Main Thread Checker: UI API called on a background thread: -[UIApplication statusBarOrientation]
PID: 11262, TID: 2146383, Thread name: (none), Queue name: BaseOperatorService, QoS: 0
Backtrace:
4 PlantsAndFlowers 0x0000000100bb4c0c __25-[MOBFBaseService _putAd]_block_invoke + 536
5 libdispatch.dylib 0x000000010104149c _dispatch_call_block_and_release + 24
6 libdispatch.dylib 0x000000010104145c _dispatch_client_callout + 16
7 libdispatch.dylib 0x0000000101050110 _dispatch_queue_serial_drain + 692
8 libdispatch.dylib 0x00000001010449a4 _dispatch_queue_invoke + 332
9 libdispatch.dylib 0x0000000101051104 _dispatch_root_queue_drain_deferred_wlh + 424
10 libdispatch.dylib 0x0000000101058100 _dispatch_workloop_worker_thread + 652
11 libsystem_pthread.dylib 0x0000000182adefd0 _pthread_wqthread + 932
12 libsystem_pthread.dylib 0x0000000182adec20 start_wqthread + 4
造成原因是因为原本 需要在主线程执行的代码 被放在了子线程里边
解决方法:在scheme 里边取消主线程检测 (如下图 不建议使用) 或者修改代码 把出问题的代码放在主线程里边即可
PID: 11262, TID: 2146383, Thread name: (none), Queue name: BaseOperatorService, QoS: 0
Backtrace:
4 PlantsAndFlowers 0x0000000100bb4c0c __25-[MOBFBaseService _putAd]_block_invoke + 536
5 libdispatch.dylib 0x000000010104149c _dispatch_call_block_and_release + 24
6 libdispatch.dylib 0x000000010104145c _dispatch_client_callout + 16
7 libdispatch.dylib 0x0000000101050110 _dispatch_queue_serial_drain + 692
8 libdispatch.dylib 0x00000001010449a4 _dispatch_queue_invoke + 332
9 libdispatch.dylib 0x0000000101051104 _dispatch_root_queue_drain_deferred_wlh + 424
10 libdispatch.dylib 0x0000000101058100 _dispatch_workloop_worker_thread + 652
11 libsystem_pthread.dylib 0x0000000182adefd0 _pthread_wqthread + 932
12 libsystem_pthread.dylib 0x0000000182adec20 start_wqthread + 4
造成原因是因为原本 需要在主线程执行的代码 被放在了子线程里边
解决方法:在scheme 里边取消主线程检测 (如下图 不建议使用) 或者修改代码 把出问题的代码放在主线程里边即可
相关文章推荐
- iOS开发 --- 推送 SDK: Main Thread Checker: UI API called on a background thread
- iOS - Xcode 9.0 :Main Thread Checker: UI API called on a background thread: 问题
- iOS Main Thread Checker: UI API called on a background thread的解释
- Main Thread Checker: UI API called on a background thread:
- Unity Xcode 8 iOS 10 出现警告 Libinfo call to mDNSResponder on main thread
- ios更新UI时请尝试使用performSelectorOnMainThread方法
- IOS真机切换UI界面时,出现“Only run on the main thread” 的解决方法
- ios更新UI时请尝试使用performSelectorOnMainThread方法
- 13、主线程任务太多导致异常退出(The application may be doing too much work on its main thread)
- iOS - 解决This application is modifying the autolayout engine from a background thread
- ios程序入口main及UIApplicationMain的研究
- iOS 错误信息 This application is modifying the autolayout engine from a background thread...
- 解决android连接网时出现“android.os.NetworkOnMainThreadException”异常的方法
- iOS之崩溃处理:This application is modifying the autolayout engine from a background thread
- iOS: 学习笔记, performSelectorOnMainThread
- iOS: 学习笔记, 使用performSelectorOnMainThread及时刷新UIImageView
- 出现 I/Choreographer: Skipped 160 frames! The application may be doing too much work on its main thre
- iOS 【程序启动原理/手动创建UIWindow/UIApplicationMain做了些什么/makeKeyAndVisible底层实现】
- iOS: 通过performSelectorOnMainThread在不同线程中更新界面
- The application may be doing too much work on its main thread.