2012-06-19 163 views
2

我有一個UIWebView在我的iPhone應用程序,有幾個按鈕的網頁,每個按鈕都有一個特殊的URL檢測鏈接點擊UIWebview

有沒有什麼辦法可以檢測到這個特定的網址被點擊的時間UIWebView

回答

-3
-(void)ButtonPressed:(id)sender { 

UIButton *btnCurrent = (UIButton*)sender; 
NSLog(@"sender%@",sender); 

NSString *str = [NSString stringWithFormat:@"%d",btnCurrent.tag]; 
    strRID =str; 
    if ([str isEqualToString:@"0"]) { 
    NSURL *urldata = [NSURL URLWithString:strLink]; 
    NSURLRequest *request = [[NSURLRequest alloc] initWithURL:urldata]; 
    [self.webRegister setScalesPageToFit:YES]; 
    [self.webRegister loadRequest:request]; 
    [request release]; 
    [super viewDidLoad]; 
    [email protected]""; 
    } 
}