0
閱讀this thread,我試圖插入一個鏈接到外部網頁上調用touch inside
上的一個按鈕(在xCode 4.6故事板中創建的按鈕)。iOS鏈接到外部頁面
這是操作:
-(IBAction)outLink:(id)sender {
[[UIApplication sharedApplication] openURL:[NSURL URLWithString: @"https://www.mysite.com/index.php"]];
}
,這頭文件(.h
):
@interface MenuViewController : UIViewController <UITableViewDataSource, UITabBarControllerDelegate>{
IBOutlet UIButton *linkToSite;
}
-(IBAction)outLink;
我有聯繫的按鈕,在故事板的元素,我已經掛了行動到Touch Up Inside
事件,但我得到這個錯誤,當我點擊按鈕上的模擬器:
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[MenuViewController outLink]: unrecognized selector sent to instance 0x717d340'
是的,謝謝你,這是它!要在9分鐘內接受 – ghego1 2013-05-04 17:05:10
最受歡迎的傢伙 – 2013-05-04 17:29:17