You can use the UIWebViewDelegate protocol for this:
// assuming webView is a valid UIWebView webView.delegate = self; - (BOOL)webView:(UIWebView *)wv shouldStartLoadWithRequest:(NSURLRequest *)rq navigationType:(UIWebViewNavigationType)nt { if (nt == UIWebViewNavigationTypeLinkCkicked) { [[UIApplication sharedApplication] openURL:[rq URL]]; return NO; } return YES; }
user529758
source share