在block回调中要去刷新界面,遇到这样的问题
This application is modifying the autolayout engine from a background thread after the engine was accessed from the main thread. This can lead to engine corruption and weird crashes.
截图如下,英语比较挫,大概意思就是说需要在主线程中去刷新UI
错误代码如下
_coutTimeV.timeOut = ^(){
[weakSelf.coutTimeV endCountDown];
[weakSelf doSomething];
};
修改后
_coutTimeV.timeOut = ^(){
[weakSelf.coutTimeV endCountDown];
//通知主线程去做刷新动作
dispatch_async(dispatch_get_main_queue(), ^{
[weakSelf doSomething];
});
};
小白总结,欢迎打脸指正