首页 > 编程语言 > 详细

只能在主线程更改界面

时间:2016-09-19 19:30:09      阅读:135      评论:0      收藏:0      [点我收藏+]

问题:

在主线程之外的线程更改界面,会报错: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.

解决方法:

把更改界面的语句写在这里面:

dispatch_async(dispatch_get_main_queue(), {

   // code here

})

只能在主线程更改界面

原文:http://www.cnblogs.com/argenbarbie/p/5886169.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!