I am trying to access request object of UIWebView in webViewDidStartLoad in the following manner:
- (void) webViewDidStartLoad:(UIWebView *)webView {
NSLog(@"req : %@", [webView request]);
-----
-----
}
It displays following in console :
req : (null)
Is the above possible or I am doing something wrong?
down vote
I donot want to use it inside webView:shouldStartLoadWithRequest:)request navigationType: as this method does not get called always for goBack and goForward methods
Looks like you will still have to consider
shouldStartLoadWithRequest.Did some testing and it looks like the
[webView request]is ‘one step behind’ in delegate methods.This was the code:
And this were the results for initial (about:blank) and after click (some video stream, not actual printout) request:
initial request:
req1a : about:blank
req1b : (null)
req2 :
after click to a link:
req1a : xttp://origin.biokoda.tv/…
req1b : about:blank
req2 : about:blank
It looks like
[webview request]is holding last loaded request.