Main Thread Checker: UI API called on a background thread: -[UIApplication applicationState]

真机运行项目,项目进入某个页面的时候会卡几秒,然后进入页面。日志输出

Main Thread Checker: UI API called on a background thread: -[UIApplication applicationState]

1、在子线程刷新UI的问题,首先定位刷新UI的地方,放到主线程中去,从根本解决这个问题。

2、关闭Xcode的主线程检测

Main Thread Checker: UI API called on a background thread: -[UIApplication applicationState]

Main Thread Checker: UI API called on a background thread: -[UIApplication applicationState]

去掉对勾,重新运行项目就不会打印了,也不会卡顿了