how to capture the clicked url on UIWebView

Posted by user262325 on Stack Overflow See other posts from Stack Overflow or by user262325
Published on 2010-04-03T11:39:29Z Indexed on 2010/04/03 11:43 UTC
Read the original article Hit count: 216

Filed under:

Hello everyone

I hope to capture the clicked url on an UIWebView

    - (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType
    {

    if (navigationType == UIWebViewNavigationTypeLinkClicked) {
    NSURL *URL = [request URL]; 
    NSString *s=[URL absoluteString];

    }

but I noticed that this URL is not the url which is clicked and will be displayed on UIWebView, normally it is the url of current web page display on UIWebView.

Welcome any comment

Thanks interdev

© Stack Overflow or respective owner

Related posts about iphone