MBProgressHUD needs to be accessed on the main thread.

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

   dispatch_async(dispatch_get_main_queue(), ^{

        

        hud = [[MBProgressHUD alloc] initWithView:weakSelf.view];

        

        hud.delegate = weakSelf;

        

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

        

        [hud showWhileExecuting:@selector(myTask) onTarget:weakSelf withObject:nil animated:YES];

        

        [weakSelf.view addSubview:hud];

        

    });



你可能感兴趣的:(第一次)