开发者

facebook graph API and parsing results in objective-C

开发者 https://www.devze.com 2023-01-21 18:40 出处:网络
I am calling this: facebook requestWithGraphPath:@\"me/friends\" andDelegate:self] Now I am confused on what facbook returns to me in the delegate?

I am calling this:

facebook requestWithGraphPath:@"me/friends" andDelegate:self]

Now I am confused on what facbook returns to me in the delegate?

How should I parse this in the (void) request:(FBRequest*) request didLoa开发者_高级运维d:(id) result method? Is it returned as a dictionary?


Yes, I think it is always a dictionary. Here is some sample code for handling the "me/friends" call:

for (NSDictionary *friendData in [result objectForKey:@"data"])
{
    id friendId = [friendData objectForKey:@"id"];
    // Extract other information about the friend
}
0

精彩评论

暂无评论...
验证码 换一张
取 消