I have a uitableview which loads data from internet and during this period im displaying MBProgressHUD. But the problem is the user cannot touch anything including previous page button before the table loads. Here is my codein two different classes:
//PROBLEM METHOD 1
- (void)viewDidLoad
{
[super viewDidLoad];
[tableEtkinlikler reloadData];
MBProgressHUD *HUD = [MBProgressHUD showHUDAddedTo:self.view animated:YES];
HUD.labelText = @"Açılıyor...";
HUD.userInteractionEnabled = NO;
[self performSelector:@selector(loadEtkinliklerTitlesAndImages) withObject:nil afterDelay:0];
tableEtkinlikler.dataSource = self;
tableEtkinlikler.delegate = self;
}
I have the same problem with a button also..In it im loading data from internet..
//PROBLEM METHOD 2
- (IBAction)AktivitelerButtonClicked:(UIButton *)sender
{
MBProgressHUD *HUD = [MBProgressHUD showHUDAddedTo:self.view animated:YES];
HUD.labelText = @"Açılıyor...";
HUD.userInteractionEnabled = NO;
[self performSelector:@selector(openAktivitelerWindow) withObject:nil afterDelay:0];
}
I believe for me that is the point of
MBProgressHUD, it gives you the opportunity show a HUD while your tasks are completed, once your tasks are completed you dismiss it so user can interact with completed data.However In some cases loading data takes so long so you might want to let the user decide to continue , choose another option or just simply go back
in your code this
HUD.userInteractionEnabled = NO;should work but problem might be thatshowHUDAddedTo:self.viewyou do not use the highest view possible in the view hierarchy.Try to use this: