I found my UI to be unresponsive while using the MBProgress HUD, while debugging on device it shows me the message "wait_fences failed to receive reply". I think i am using MBProgressHUD in wrong way. can someone please tell me what's the best way to use MBProgressHUD in following scenario.
if (!self.detailController) {
DetailViewController *detailVC = [[DetailViewController alloc] initWithNibName:@"DetailViewController" bundle:nil];
detailVC.view.autoresizingMask = baseView.autoresizingMask; //(baseView Alerady added on xib for orientation purpose)
self.detailController = detailVC;
[detailVC release];
}
[self.view addSubview: self.detailController.view]; //Removing detailController.view before calling to this function.
[self.detailController makeServiceCall];
-(void)makeServiceCall
{
//HUD is class level variable
if (!HUD) {
HUD = [[MBProgressHUD alloc] initWithView:self.view.window];
HUD.dimBackground = YES;
[self.view.window addSubview:HUD];
HUD.labelText = @"";
}
//Showing the HUD progress bar
[HUD show:YES];
//Async call code for service call, once connection end hiding the HUD.
}
-(void)parsingFinished
{
//Data handling goes here..
[HUD hide:YES];
}
I researched on the UI unresponsiveness and found that HUD needs to be shown in viewDidAppear method, but i am adding view as subview and because of that viewDidAppear does not being called.
If I am removing HUD from my app, it works very well, so i am sure the app is unresponsive because of the usage of HUD in wrong way. I have done this at lot many places of my application. need best solution that i can apply.