報錯
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
-w719
原因及解決
這是Xcode 9以后的新特性:主線程檢測器(Main Thread Checker)徒役;
1.檢查代碼
出現(xiàn)的時候意味著本來需要在主線程執(zhí)行的代碼(比如UI刷新)种玛,被放在了子線程里邊執(zhí)行蟆技,此時仔細(xì)檢查代碼辫塌,把在UI刷新誤操作在子線程中的代碼墓律,回到主線程中!
2.關(guān)閉檢測器
-w880