无法将字符串设置为URLWithString

问题描述:

我对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? 感谢

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

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