This application is modifying the autolayout engine from a background thread, which can lead to engine corruption and weird crashes.

升级iOS9.1、xcode7.1后,

iOS也有类似android4.0之后在子线程中不能更新UI的规定了,

如果在后台线程中操作UI的话,

会提示如下错误:

This application is modifying the autolayout engine from a background thread, which can lead to engine corruption and weird crashes.  This will cause an exception in a future release.

这时必须将更新UI的代码放进dispatch_async中进行调用:

dispatch_async(dispatch_get_main_queue(), {

//更新ui

})

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容