- iOS 解决Main Thread Checker: UI AP
- Main Thread Checker
- Main Thread Checker: UI API call
- 使用MBProgressHUD 卡顿 报Main Thread
- xcode打印Main Thread Checker: UI A
- iOS / AssertAutolayoutOnAllowedT
- Main Thread Checker: UI API call
- [iOS]提醒Main Thread Checker: UI A
- Xcode Main Thread Checker
- Main Thread Checker: UI API call
报错
Main Thread Checker: UI API called on a background thread: -[UIApplication applicationState]
PID: 61808, TID: 11632650, Thread name: (none), Queue name: com.apple.root.user-initiated-qos, QoS: 25
![](https://img.haomeiwen.com/i5540443/a09acc65cd006a5f.jpg)
原因及解决
这是Xcode 9以后的新特性:主线程检测器(Main Thread Checker);
1.检查代码
出现的时候意味着本来需要在主线程执行的代码(比如UI刷新),被放在了子线程里边执行,此时仔细检查代码,把在UI刷新误操作在子线程中的代码,回到主线程中!
2.关闭检测器
![](https://img.haomeiwen.com/i5540443/b8c6b86acbe85b81.jpg)
网友评论