2011-05-08 94 views

回答

0

您的管理員必須回覆<UIWebViewDelegate>

然後,重寫這個方法:

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

    if (navigationType == UIWebViewNavigationTypeLinkClicked) 
    { 
     NSURL *URL = [request URL]; 
     if ([[URL absoluteString] rangeOfString:@"http://give.it.a.custom.url.to.identify.this.action"].length > 0) 
     { 
      // your custom action here 
     } 

     return NO; 
    } 
    return YES; 
} 

不要忘了[youWebView setDelegate:self];