hay algo extraño en mi código. Estoy seguro de olvidar algo, pero no sé qué. Intento manejar los enlaces de teléfono, sms mailto y http en un UIWebView.UIWebView enlaces de teléfono detección en iphone
esto es cómo i trato:
1/instanciar los UIWebView:
webview = [[UIWebView alloc] initWithFrame:CGRectMake(0,0,320,460)];
webview.opaque = NO;
webview.backgroundColor = [UIColor clearColor];
webview.userInteractionEnabled = YES;
webview.dataDetectorTypes = UIDataDetectorTypeAll;
2/set el delegado apropiado:
[webview setDelegate: self];
3/implementar el método delegado (versión simplificada aquí):
- (BOOL)webView:(UIWebView *)webView
shouldStartLoadWithRequest:(NSURLRequest *)request
navigationType:(UIWebViewNavigationType)navigationType; {
NSURL *requestURL = [[ request URL] retain];
NSLog(@">>> %@", [requestURL scheme]);
[requestURL release];
return YES;
}
Con mi dispositivo de depuración cuando toco un enlace http, se imprime el NSLog. Cuando toco un enlace tel tengo este tipo de mensaje de confirmación:
alt text http://cahripub.com/images/bug.gif
Con el simulador de iPhone, enlaces http tel y se imprimen correctamente por NSLog.
Weird, no?
precisión, he intentado un poco con cada valores dataDetectorTypes! – lefakir
He intentado con sms y enlaces de mailto. También están correctamente impresos por NSLog. – lefakir