我正在尝试从Facebook阅读好友列表并在TableView中显示,但我没有任何反应。我代表的代码和平:
if (![facebook isSessionValid]) {
NSArray *permissions = [[NSArray alloc] initWithObjects:
@"user_location",
@"friends_location",
@"read_friendlists",
nil];
[facebook authorize:permissions];
[permissions release];
}
[facebook requestWithGraphPath:@"me/friends" andDelegate:self];
request:didLoad
方法看起来像:
-(void)request:(FBRequest *)request didLoad:(id)result {
_contacts = result;
}
contacts
这是我的实例NSArray,我想填写Facebook的联系人。在tableViewController
我做了下一件事:
AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
cell.textLabel.text = [appDelegate.contacts objectAtIndex:indexPath.row];
结果我在tableView中没有任何内容。我对我做错了什么感兴趣?我一般都是以正确的方式做的?
答案 0 :(得分:2)
你确定,这个结果是NSArray的实例,而不是NSDictionary吗?我现在正在使用fb iOS SDK,并且由于相同的请求而获得了NSDictionary。字典有两个关键路径:'data'(包含NSArray和所需的朋友)和'paging'。