IOS:Main Thread Checker: UI API called on a background thread: -[UIImageView setImage:] PID: 17771, TID:

在NSURLSession的接口回调中,使用了设置UI的操作

然后就报了这个错误,这个应该是因为NSURLSession开了子线程去调用,而Ui的操作需要在主线程中,获得主线程然后去操作即可

 dispatch_sync(dispatch_get_main_queue(),^{
                             //UI操作的代码
                        });
原文地址:https://www.cnblogs.com/kc1995/p/14245071.html