Hi I just wanted to know how to extract url from webview after loading the web view with the method [webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@”http://m.nytimes.com”%5D%5D%5D;
In this, I am loading the page with nytimes. When the user navigates to the new page I wan to find out the url the moved page. Is there any way I can find it?
Thanks
You will need a class to implement the UIWebViewDelegate Protocol, then set an instance of that class to be the delegate of the webview. The method you will want to implement is:
In that delegate method, you can get the url by inspecting the
requestproperty of the web view.Edit: Changed the recommended delegate method due to Anomie’s comment pointing out my failure to see the request propery of UIWebView.