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

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(),^{

//你要写的代码

});

你可能感兴趣的:(IOS添加页面,会出现线程错误)