判斷是否在主線程執(zhí)行
//隱藏加載框
+ (void)hiddenLodingHUDFromView:(UIView *)view animated:(BOOL)animated
{
if ([[NSThread currentThread] isMainThread]) {
[MBProgressHUD hideHUDForView:view animated:animated];
} else {
dispatch_sync(dispatch_get_main_queue(), ^{
[MBProgressHUD hideHUDForView:view animated:animated];
});
}
}