MBP菊花加载 MBProgressHUD needs to be accessed on the main thread.

引用第三方风火轮的时候 刚开始没问题 后来就开始崩溃了,原因是要放在主线程运行.

dispatch_async(dispatch_get_main_queue(), ^{

hud= [[MBProgressHUDalloc]initWithView:weakSelf.view];

hud.delegate= weakSelf;

hud.labelText=@"客官,正在加载...";

[hudshowWhileExecuting:@selector(myTask)onTarget:weakSelfwithObject:nilanimated:YES];

[weakSelf.viewaddSubview:hud];

});

网上搜到的都是开辟主线程。。。不知道还有好的解决办法没,找到问题的根源。

你可能感兴趣的:(MBP菊花加载 MBProgressHUD needs to be accessed on the main thread.)