IOS添加页面,会出现线程错误

2017-09-25  本文已影响0人  无聊之人1123

This application is modifying the autolayout engine from a background thread after the engine was accessed from the main thread. This can lead to engine corruption and weird crashes.

出现该问题的原因是没有回归到主线程,需要在加

dispatch_async(dispatch_get_main_queue(),^{

//你要写的代码

});

上一篇 下一篇

猜你喜欢

热点阅读