obtener el texto del enlace en uiwebview

I am using the code below to detect a link tap on my uiwebview. Is there a way to get the text of the link that has been tapped by the user?

    - (BOOL)webView:(UIWebView*)webView shouldStartLoadWithRequest:(NSURLRequest*)request navigationType:(UIWebViewNavigationType)navigationType {
    NSLog(@"link tapped");
    if(navigationType == UIWebViewNavigationTypeLinkClicked) {


        //if (overrideLinksSwitch.on == TRUE) {
             NSLog(@"navigation link tapped");
          //  [self myMethodAction];

          //  [myWebView stopLoading];
            [[UIApplication sharedApplication] openURL:[NSURL URLWithString:linktapped]];
            return NO;
        }



    return YES;
}

Cualquier ayuda apreciada.

preguntado el 09 de marzo de 12 a las 15:03

Do you want the URL that was selected by the user? -

Yes bschultz that is what i want. -

1 Respuestas

NSURLRequest tiene un URL propiedad. NSURLSolicitud

Just get the URL from the request object in your method.

respondido 09 mar '12, 15:03

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.