Take the 2-minute tour ×

a few days ago I had this working where after you login to facebook you can click a button and an FBFriendPickerViewController would appear with a list of all facebook friends. However, suddenly it has started to crash with some weird errors. Here is my code:

    return [FBSession.activeSession handleOpenURL:url];

- (BOOL)application:(UIApplication *)application
        openURL:(NSURL *)url
  sourceApplication:(NSString *)sourceApplication
     annotation:(id)annotation {
// attempt to extract a token from the url
return [FBSession.activeSession handleOpenURL:url];

In my home viewcontroller.m

// Pick Friends button handler
- (IBAction)pickFriendsClick:(UIButton *)sender {
FBFriendPickerViewController *friendPicker = [[FBFriendPickerViewController alloc] init];
self.friendPickerController = friendPicker;

[friendPicker loadData];

// Create navigation controller related UI for the friend picker.
friendPicker.navigationItem.title = @"Pick Friends";

friendPicker.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc]
friendPicker.navigationItem.hidesBackButton = YES;

// Make current.
[self.navigationController pushViewController:friendPicker animated:YES];

// Handler for when friend picker is dismissed
- (void)friendPickerDoneButtonWasPressed:(id)sender {

[self.navigationController popViewControllerAnimated:YES];

NSString *message;

if (self.friendPickerController.selection.count == 0) {
    message = @"<No Friends Selected>";
} else {

    NSMutableString *text = [[NSMutableString alloc] init];

    for (id<FBGraphUser> user in self.friendPickerController.selection) {
        if ([text length]) {
            [text appendString:@", "];
        [text appendString:user.name];
    message = text;

[[[UIAlertView alloc] initWithTitle:@"You Picked:"

And finally here is the error message I am getting when the button set up to the pickFriendsClick method is hit:

2012-07-18 19:22:14.978 MeetUp[7213:1dc03] -[__NSDictionaryI length]: unrecognized selector sent to instance 0xa9b7c70 2012-07-18 19:22:14.980 MeetUp[7213:1dc03] * Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSDictionaryI length]: unrecognized selector sent to instance 0xa9b7c70' * First throw call stack: (0x1f626a2 0x13ede7e 0x1feda3d 0x1f522bc 0x1f5204e 0x1edd7d0 0x1ef5c98 0x1fcff7b 0x1ef5b42 0xde4d5a 0xe3ace8 0xe3ac93 0x20138 0x20718 0x410ffb 0x4110cf 0x3f9e1d 0x40a4db 0x3a79ba 0x14016be 0x25a53a6 0x259973c 0x2599550 0x2517690 0x25187fb 0x2518eb6 0x1f2b27e 0x1f2b1bd 0x1f08f22 0x1f086a4 0x1f0857b 0x1a7a913 0x1a7a798 0x358e7c 0x205d 0x1f85) libc++abi.dylib: terminate called throwing an exception

Again, the login and logout functionality I have implemented is working great, and this was working not too long ago however now it is giving me trouble. Any help would be greatly appreciated. Thanks!

EDIT: Okay so I added this line of code: [friendPicker setItemPicturesEnabled:NO]; and it now works however obviously I do not get the little thumbnail profile pictures in the tableview cells.

I guess the error is that it for some reason crashes (SIGABRT) when it is trying to load the profile pictures. If anyone knows why this is that would be great, especially seeing as it worked and loaded the pictures a couple days ago.

share|improve this question
Bug issued to Facebook, they tried to close it, claiming the ball is not at their court. Please help by commenting on the bug page: developers.facebook.com/bugs/340523759367074 –  Tal Yaniv Aug 19 '12 at 13:53
I was facing the same problem, but I solved this issue. See my answer: stackoverflow.com/a/12257643/1553533 –  Muhammad Farooq Sep 4 '12 at 6:07

1 Answer 1

Going to add your content to the answer as I came across the same issue and tldr and missed the hack solution.

The stack trace shows an exception being thrown at a line:

[FBGraphObjectTableDataSource tableView:imageForItem:]

Ergo setting:

self.friendPickerController.itemPicturesEnabled = NO;

seems to fix the issue as it won't load images.

share|improve this answer

Your Answer


