在fbconnect问题中从朋友列表问题中获取10个朋友

时间:2010-07-31 07:40:07

标签: iphone fbconnect

我正在尝试使用fbconnect获取10个朋友列表,我的查询是这样的,

NSString* fql = [NSString stringWithFormat:@"select uid from user where uid == %lld LIMIT 1,10", _session.uid];

NSDictionary* params = [NSDictionary dictionaryWithObject:fql forKey:@"query"];

[FBRequest requestWithDelegate:self] call:@"facebook.friends.get" params:params];

但它取得了所有朋友名单,任何人都帮助我......

1 个答案:

答案 0 :(得分:0)

NSString* fql =[NSString stringWithFormat:@"SELECT uid,name FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1 = %lld) LIMIT 1,10",_session.uid]; 

NSMutableDictionary * params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
                                fql, @"query",
                                nil];

[_facebook requestWithMethodName: @"fql.query" 
                       andParams: params
                   andHttpMethod: @"POST" 
                     andDelegate: self];