Hi
I have an app that loads a UIWebView. And that works well. It is possible for the user to click a link in the web view which then creates a new view controller/web view to load the link, which also works well.
What isn't working so well, is that sometimes (1/4 maybe) when I come back to the initial web view, the view is blank white.
The controller is not being dealloced, and is not receiving memory warning in between. And I'm totally puzzled.
Anyone know what's going on, and more especially, how to fix it?
Here are any methods that have anything to do with the controllers:
Initial Controller:
- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType
{
if (navigationType == UIWebViewNavigationTypeLinkClicked)
{
WebView * wv = [[WebView alloc] initWithNibName:@"WebView" bundle:nil];
UIBarButtonItem *backBar = [[UIBarButtonItem alloc] initWithTitle:@"Back to the Article" style:UIBarButtonItemStyleDone target:nil action:nil];
self.navigationItem.backBarButtonItem = backBar;
[backBar release];
[[UIAppDelegate navigationController] pushViewController:wv animated:YES];
[[wv webView] loadRequest:request];
[wv release];
}
return NO;
}
else
return YES;
}
Other controller (WebView):
- (void)viewDidLoad {
[super viewDidLoad];
[webView setDelegate:self];
}