facebook api requestWithGraph不起作用

时间:2011-08-02 14:30:56

标签: objective-c facebook facebook-graph-api

我正在使用facebook API,下一行导致我出现问题:

[facebook requestWithGraphPath:(@"%@/friends",[tmpFriendID objectAtIndex:i]) andDelegate:self];

我需要访问某些联系人的朋友,所以我传递了联系人/朋友的-ID,但不知何故,它只发送了ID,因此我不会得到朋友,而是联系人资料。

我做错了什么?

1 个答案:

答案 0 :(得分:0)

删除关闭的paranthesis

更改此

 [facebook requestWithGraphPath:@"%@/friends",[tmpFriendID objectAtIndex:i]) andDelegate:self];

 [facebook requestWithGraphPath:[NSString stringWithFormat:@"%@/friends",[tmpFriendID objectAtIndex:i]] andDelegate:self];

OR

 [facebook requestWithGraphPath:[NSString stringWithFormat:@"%i/friends",[tmpFriendID objectAtIndex:i]] andDelegate:self];

此外,请参阅我的回答获取好友列表

Retrieve Facebook friends list