jdg/MBProgressHUD — Issue #49: Loading circle dont appear during UIWebView loading
Author: MrKAA
Created: 2012-02-23 05:17:43+00:00
State: open

How to show loading while web view is loading data?

- (void)viewDidLoad
{
[super viewDidLoad];

HUD = [[MBProgressHUD alloc] initWithView:self.view];
[self.view addSubview:HUD];

HUD.dimBackground = YES;

// Regiser for HUD callbacks so we can remove it from the window at the right time
HUD.delegate = self;

// Show the HUD while the provided method executes in a new thread
[HUD showWhileExecuting:@selector(loadContent) onTarget:self withObject:nil animated:YES];
}

-(void)loadContent{

NSString *path = [NSString stringWithFormat:@"http://abc.com/test/test.php?name=John"];

NSURL *url0 = [NSURL URLWithString:path];
request = [NSURLRequest requestWithURL:url0];
[_webViewDzivnieks loadRequest:request];

}