I am using MBProgressHUD
Custom Control to show when loading JSON Data from web.
I have already find a lot of answer that doesn't show correctly HUD Control in their View.
Here is my code to show HUD
in my View.
[MBProgressHUD showHUDAddedTo:self.view animated:YES];
and Here is how i hide my HUD
View.
[MBProgressHUD hideHUDForView:self.view animated:YES];
In ViewDidLoad , that control is working fine.
But when i click to refresh button and want to show HUD control , it doesn't show HUD Control.
[MBProgressHUD showHUDAddedTo:self.view animated:YES];
dispatch_queue_t myqueue = dispatch_queue_create("queue", NULL);
dispatch_async(myqueue, ^{
[self performSelectorOnMainThread:@selector(fetchedData:) withObject:nil waitUntilDone:YES];
dispatch_async(dispatch_get_main_queue(), ^{
[self.tbl reloadData];
[MBProgressHUD hideHUDForView:self.view animated:YES];
});
});
I don't know what am I doing wrong? Please help me.