线程:This application is modifying the autolayout engin from a background thread

来源:互联网 发布:linux系统怎么操作 编辑:程序博客网 时间:2024/06/08 19:55

http://blog.csdn.net/fuzongjian/article/details/50621676

昨天处理相册问题是,遇到这样的问题:

[objc] view plain copy
 在CODE上查看代码片派生到我的代码片
  1. This application is modifying the autolayout engin from a background thread,which can lead to engine corruption and weird crashes,This will cause an exception in a future rellease  


看看下面的截图也许就能明白点儿什么


我自己的是这样的写的:(大致意思是我避开了主线开辟了一个线程去相册读取数据,拿到数据后我直接去更新数据,而不是代码回到主线程中去更新数据



搞明白错误在哪,修改八阿哥手到擒来:


所以说,从别的线程中拿到数据源后,必须回到主线程中更新数据和UI。


0 0