I am currently using FBFriendPicker from the Facebook API for iOS to get a selected friend's name. How might I obtain the friend's userID at the same time? The function below is used for the name:
// Facebook integration
- (void)facebookViewControllerDoneWasPressed:(id)sender {
NSString *text;
// we pick up the users from the selection, and create a string that we use to update the text view
// at the bottom of the display; note that self.selection is a property inherited from our base class
for (id<FBGraphUser> user in self.friendPickerController.selection) {
self.name.text = user.name;
}
[self dismissModalViewControllerAnimated:YES];
}
for (id<FBGraphUser> user in self.friendPickerController.selection) {
NSLog(@"Name: %@ ID: %@", user.name, user.id);
}
I know the Name and the ID of the friends picked will show in the Log this way..
So instead of using "name", just use "id", thats if you want to use it as a string.. :)