2014-01-16 69 views
-2

UIApplication Expecting ':'上獲取錯誤。XCode 5 - OpenURL無法在ViewController中工作

@interface ViewController() 

@end 

@implementation ViewController 

-(IBAction) pushButton{ 
    [[UIApplication sharedApplication openURL: [NSURL URLWithString:@"http://www.portfoliopathway.com"]]; 
} 
+0

我的答案是否解決了您遇到的問題? –

回答

0

您錯過了sharedApplication後的右括號。

-(IBAction) pushButton{ 
    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"http://www.portfoliopathway.com"]]; 
}