I am trying to avoid the blank white window that shows while a UIWebView loads content. Instead of putting a background on the UIWebView, I'd like to just put up a HUD on the current window and then push the new uiviewcontroller that contains the uiwebview when the content is loaded. Here's what I've done (code shortened for sanity's sake):
FirstView:
MyViewController *myVC = [[MyViewController alloc] initWithNibName:@"MyViewController" bundle:nil];
myVC.parentController = self.navigationController;
UIView *myView = [myVC view]; // Force view to load
MyViewController:
- (void)viewDidLoad
{
...
[myWebView setDelegate:self];
[myWebView loadHTMLString:htmlString baseURL:baseURL];
...
}
- (void) webViewDidFinishLoad:(UIWebView*) webView {
[parentController pushViewController:self animated:YES];
}
OK, so viewDidLoad
is getting called, but none of the uiwebviewdelegate methods are getting called. However, if I push the view controller
FirstView:
MyViewController *myVC = [[MyViewController alloc] initWithNibName:@"MyViewController" bundle:nil];
[self.navigationController myVC animated:YES];
Then all of the uiwebviewdelegate methods in MyViewController
do get called.
I'm stuck.