есть небольшая проблема с MBProgressHUD. У меня есть веб-просмотр и я хочу отображать HUD во время загрузки данных.
HUD появляется, но остается на несколько секунд и уже исчезает, но веб-просмотр не завершился загрузкой.
-(void)viewDidAppear:(BOOL)animated{
// Should be initialized with the windows frame so the HUD disables all user input by covering the entire screen
HUD = [[MBProgressHUD alloc] initWithWindow:[UIApplication sharedApplication].keyWindow];
// Add HUD to screen
[self.view.window addSubview:HUD];
// Regisete for HUD callbacks so we can remove it from the window at the right time
HUD.delegate = self;
HUD.labelText = @"Loading";
HUD.detailsLabelText = @"updating data";
// Show the HUD while the provided method executes in a new thread
[HUD showWhileExecuting:@selector(loadingWebView) onTarget:self withObject:nil animated:YES];}
- (void) loadingWebView {
NSString *fullURL = beverageViewString;
NSURL *url = [NSURL URLWithString:fullURL];
NSURLRequest *requestObj = [NSURLRequest requestWithURL:url];
[beverageView loadRequest:requestObj];
NSLog(@"%@",beverageViewString);}