2013-04-23 26 views
-1

我試圖通過將URL鏈接到按鈕來從DashboardViewController打開網頁。我有以下代碼:如何使用iOS應用程序中的按鈕打開網頁?

- (IBAction)facebook:(id)sender { 
    [[DashboardViewController sharedApplication] openURL:[NSURL URLWithString:@"http://www.facebook.com"]]; 
} 

然而,這將引發錯誤:

[DashboardViewController sharedApplication]: unrecognized selector sent to class 0xaba8 
2013-04-22 23:23:35.264 LoginScreen[37692:c07] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[DashboardViewController sharedApplication]: unrecognized selector sent to class 0xaba8' 

是否有人可以幫助我?

+1

這與Xcode完全沒有關係。此外,這個問題有幾十個重複。你需要學習Objective-C的基礎知識。 – 2013-04-23 04:34:41

+0

謝謝,我多次看到這個問題,但沒有解決這個具體的錯誤。 – spatra 2013-04-23 04:38:06

回答

相關問題