In a class that implements the FBRequestDelegate and FBSessionDelegate do this:
-(void) getFriends{
NSString * funcName = @"friends.get";
[[FBRequest requestWithDelegate:self] call:funcName params:nil];
}
- (void) processFriendsQuery:(id) result{
friends = [[NSMutableArray alloc] init];
NSString * element;
gDatabase.userIdList = [[[NSMutableArray alloc] initWithCapacity:MAX_FRIENDS_LIST] autorelease];
for (element in result){
Friend * aFriend = [[[Friend alloc] init]autorelease];
NSString * uid = [self dictionaryToUID:element];
aFriend.userId = (NSMutableString *) uid;
[gDatabase.userIdList addObject:aFriend.userId];
}
and then call it in
- (void)request:(FBRequest*)request didLoad:(id)result {
[self processFriendsQuery:result];
}