0

Code is simple, So I don't think it's caused by code, I hide some unrelevent code.

- (void)viewDidLoad {
    [super viewDidLoad];
    _webView = [[UIWebView alloc] init];
    [self.view addSubview:_webView];
    _webView.delegate = self;
    [_webView loadRequest:[NSURLRequest requestWithURL:self.url]];
}  

- (void)webViewDidFinishLoad:(UIWebView *)webView {
    NSLog(@"hello,world");
}

Once running the app, overtime the website is shown in the webView, but the NSLog(@"hello,world") seems not calls every time.(sometimes is called,sometimes is not called).
I have to help web developer to find the bug, and I guess it is caused by some web bug, and I need to know.

childrenOurFuture
  • 1,889
  • 2
  • 14
  • 23

1 Answers1

0

Implement below Delegate method to check error

-(void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error {
NSLog(@"Error for WEBVIEW: %@", [error description]);
}

if problem is not identify possible look this link

UIWebView webViewDidFinishLoad not getting called iOS

Community
  • 1
  • 1
S Patel
  • 36
  • 2