mainDocumentURL
Returns the main document URL associated with the request.
- (NSURL *)mainDocumentURL
Return Value of [NSURLRequest mainDocumentURL]
The main document URL associated with the request.
Discussion of [NSURLRequest mainDocumentURL]
This URL is used for the cookie “same domain as main document” policy.
Example of [NSURLRequest mainDocumentURL]
- (void)webViewDidStartLoad:(UIWebView *)webView{
myRequestedUrl= [webView.request mainDocumentURL];
NSLog(@"Requested url: %@", myRequestedUrl);
}
- (void)webViewDidFinishLoad:(UIWebView *)webView{
myLoadedUrl = [webView.request mainDocumentURL];
NSLog(@"Loaded url: %@", myLoadedUrl);
//psudocode
if(myRequestedUrl is not the same as myLoadedUrl){
doSomething
}
}