I have an UIWebView in one tab that loads in viewDidLoad, but if user taps other tab the loading will be disrupted and
- (void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error
will be called, but I want to know how can check if webView is loaded if user taps the previous tab again, and if it s not loaded it will reload it, something like this
-(void)viewWillAppear:(BOOL)animated
{
if (!webView)
{
NSURL *url = [NSURL URLWithString:@"url"];
NSURLRequest *request = [NSURLRequest requestWithURL:url];
[webView loadRequest:request];
}
}
但它没有工作,请帮助?