当我尝试推送视图控制器时,MPProgressView 不会显示,直到显示推送的 VC 前几秒钟。viewController 是否应该放在与显示 MBProgressView 相同的功能中?我已经确保我的 MBProgressView 在主线程上,我在 SO 上尝试了许多解决方案,但看不到任何有同样问题的人。我只是想在加载和推送 viewController 时显示 MBProgressHUD。谢谢!
我正在使用 MBProgressView 如下:
- (IBAction)pushButton:(id)sender
{
self.HUD =[MBProgressHUD showHUDAddedTo:self.view animated:YES];
[self.view addSubview:self.HUD];
self.HUD.labelText = @"Doing stuff...";
self.HUD.detailsLabelText = @"Just relax";
self.HUD.delegate=self;
[self.view addSubview:self.HUD];
[self.HUD showWhileExecuting:@selector(loadCreate) onTarget:self withObject:nil animated:YES];
}
- (void)loadCreate {
[self performSelectorOnMainThread:@selector(dataLoadMethodMail) withObject:nil waitUntilDone:YES];
}
-(void)dataLoadMethodMail
{NSLog(@"data load method is displaying");
SelectViewController *mvc = [[SelectViewController alloc] init];
[self.navigationController pushViewController:mvc animated:YES];
}