Ios Can';t将字符串设置为URLWithString

Ios Can';t将字符串设置为URLWithString,ios,nsstring,nsobject,url-scheme,Ios,Nsstring,Nsobject,Url Scheme,我对Facebook页面的操作有问题 currentVriend是一个NSObject类 我得到错误:方法调用的参数太多,预期1有2个 -(void)goFB { NSURL *url = [NSURL URLWithString:@"fb://profile/%g",self.currentVriend.fbid]; [[UIApplication sharedApplication] openURL:url]; } 我做错了什么? 也许再做一个字符串? 谢谢我相信您缺少正确

我对Facebook页面的操作有问题

currentVriend
是一个
NSObject

我得到错误:
方法调用的参数太多,预期1有2个

-(void)goFB
{
    NSURL *url = [NSURL URLWithString:@"fb://profile/%g",self.currentVriend.fbid];
    [[UIApplication sharedApplication] openURL:url];
}
我做错了什么? 也许再做一个
字符串

谢谢

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

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

我认为您缺少正确的NSString方法

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

我认为您缺少正确的NSString方法

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

我认为您缺少正确的NSString方法

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