您的位置:首页 > 移动开发

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 里边取消主线程检测 (如下图   不建议使用) 或者修改代码 把出问题的代码放在主线程里边即可 

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐