我正在玩 MBProgressHUD。视图控制器(tableview)中的工作流程是这样的:
1) 调用 IBAction 以在 2 个不同的表之间切换 2.1) 调用函数reloadAllMonth
(使用新表的数据初始化数组) 2.2) MBProgressHUD *HUD 应该显示 3) reloadAllMonth 完成 4) HUD 应该消失
我当前的代码:
-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{
//sparing you the code that determins where the tap occured
HUD = [[MBProgressHUD alloc]initWithFrame:self.view.frame];
[MBProgressHUD showHUDAddedTo:self.view animated:YES];
[self reloadAllMonth];
allMonthIsActive = YES;
[MBProgressHUD hideHUDForView:self.view animated:YES];
// some other code table reload etc.
}
怎么了:
-> 函数 touchesbegan 被调用 -> 3-4 秒内没有任何反应(加载时间) -> 弹出新表
问题:为什么HUD不显示?我哪里做错了 ?