2014-08-28 82 views
0

我對Facebook頁面的操作有問題。無法將字符串設置爲URLWithString

currentVriend是一個NSObject類。

我得到的錯誤:too many arguments to method call expected 1 have 2

-(void)goFB 
{ 
    NSURL *url = [NSURL URLWithString:@"fb://profile/%g",self.currentVriend.fbid]; 
    [[UIApplication sharedApplication] openURL:url]; 
} 

什麼我做錯了嗎? 也許再做一個String? 感謝

回答

3

我相信你缺少正確的NSString方法

NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"fb://profile/%g",self.currentVriend.fbid]];