主线程刷新UI崩溃问题,Modifications to the layout engine must not be performed from a background thread after it has been accessed from the main thread.大概意思是:不能在后台线程中改变UI布局,必须在主线程中执行。
解决方法:添加同步执行
dispatch_sync(dispatch_get_main_queue(), ^{
//刷新UI的代码放到主线程执行
});