from: http://blog.sina.com.cn/s/blog_4adf31ea0102dtjv.html
(BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType;
{
NSURL *requestURL =[ [ request URL ] retain ];
if ( ( [ [ requestURL scheme ] isEqualToString: @"http" ] || [ [ requestURL scheme ] isEqualToString: @"https" ] || [ [ requestURL scheme ] isEqualToString: @"mailto" ])
&& ( navigationType == UIWebViewNavigationTypeLinkClicked ) ) {
return ![ [ UIApplication sharedApplication ] openURL: [ requestURL autorelease ] ];
}
[ requestURL release ];
return YES;
}
前题是实现代码:
UIWebView *web=[[UIWebView alloc] initWithFrame:CGRectMake(0, 83, 1024, 620)];
web.delegate=self;