通过堆栈的提示,知道是在子线程中做了一些UI操作。 并且知道是-[CommentNetwordRequest cancelNetword]
中的-[UIApplication setNetworkActivityIndicatorVisible:]
;
找到代码:
- (void)cancelNetword {
[self.urlConnection cancel];
[[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:NO];
}
修改为:
- (void)cancelNetword {
[self.urlConnection cancel];
dispatch_async(dispatch_get_main_queue(), ^{
[[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:NO];
});
}