今天在使用MBProgressHUD时崩了,提示如下图
显示错误提示MBMainThreadAssert();

点击看了下说明如下:
#define MBMainThreadAssert() NSAssert([NSThread isMainThread], @"MBProgressHUD needs to be accessed on the main thread.");
提示必须在主线程中访问。

解决办法:
dispatch_async(dispatch_get_main_queue(), ^{
hud.minShowTime = 6;
[hud show:YES];
});
网友评论