I have successfully used the webView delegate because of the long time. But recently I came across this issue with this delegation. In my current project, I am trying to access my router from webview. I skip the username and password only inside the URL. Below is the download request code.
[self.webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://uname: password@192.168.1.1 "]]];
This calls the webView delegate method (webViewDidFinishLoad and webViewDidStartLoad) 5 times. Expected? When I pass in a simple url like google.com, it works as expected. But with username and password, why are these delegate methods called 5 times?
If this is correct, then I need to know why it only calls 5 times. The reason is that in my program I call performSegueWithIdentifier in the webViewDidFinishLoad method, in which case it calls segue 5 times. For a workaround, I can maintain the counter and only call performSegueWithIdentifier on the 5th counter.
thanks
source share