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

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

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


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

线程:This application is modifying the autolayout engin from a background thread_第1张图片

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


线程:This application is modifying the autolayout engin from a background thread_第2张图片

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

线程:This application is modifying the autolayout engin from a background thread_第3张图片

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

你可能感兴趣的:(移动端_iOS)