Question

I have some problems with Facebook SDK 3.5.1

I got a Facebook access token and user info successfully. but when I tried to get user's(Me/Friends) profile image using FBProfilePictureView, My App always crashes.

give ANY clues for help.

btw, sorry for bad english :(

thanks.

Login with SDKs:

NSArray *permissions = @[@"publish_stream", @"publish_actions"];

FBSessionTokenCachingStrategy *tokenCache = [[FBSessionTokenCachingStrategy alloc] initWithUserDefaultTokenInformationKeyName:kFacebookTokenCache];
[FBSession setActiveSession:[[FBSession alloc] initWithAppID:FB_APP_ID permissions:permissions defaultAudience:FBSessionDefaultAudienceEveryone urlSchemeSuffix:nil tokenCacheStrategy:tokenCache]];
[FBSession openActiveSessionWithPublishPermissions:permissions defaultAudience:FBSessionDefaultAudienceFriends allowLoginUI:YES completionHandler:^(FBSession *session, FBSessionState status, NSError *error) {
// some codes here.
}];

when get FB token successfully, I want to make custom Facebook friends list view controller. so I tried like this:

[[FBRequest requestForGraphPath:@"/me/friends"] startWithCompletionHandler:^(FBRequestConnection *connection, id result, NSError *error) {
            if (error) {

            } else {
                FBGraphObject *objects = result;

                NSLog(@"%@", result);

                NSArray *keys = [objects allKeys];

                for (NSString *key in keys) {
                    if ([key isEqualToString:@"data"]) {
                        self.dataArray = [objects objectForKey:key];
                    } else if ([key isEqualToString:@"paging"]) {
                        self.nextPage = [[objects objectForKey:@"paging"] objectForKey:@"next"];
                    }
                }
            }
            [self.tableView reloadData];
            [self hideLoading];
        }];

then tableView shows my friends:

 - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
... codes here

NSDictionary *user = [self.dataArray objectAtIndex:indexPath.row];

cell.friendName.text = [user objectForKey:@"name"];
cell.profileView.profileID = [user objectForKey:@"id"];   // <<<-- !!!

... returning cell
}

then BOOM!!!

if I remove a line cell.profileView.profileID = [user objectForKey:@"id"]; my programs all OK. no crashes. but...** SIGH **

this is the results.

FBCacheIndex: Expecting result 101, actual 10 2013-06-05 16:15:59.277

ZPad[14403:a007] FBCacheIndex: SQLite error: disk I/O error 2013-06-05 16:15:59.278

ZPad[14403:a007] * Assertion failure in -FBCacheIndex _removeEntryFromDatabaseForKey:, /Users/facebookSDK/src/FBCacheIndex.m:562 2013-06-05 16:15:59.279

ZPad[14403:a007] * Terminating app due to uncaught exception NSInternalInconsistencyException', reason: ''

* First throw call stack: (0x312602a3 0x390d497f 0x3126015d 0x31b35b13 0x280fb1 0x27db95 0x394ec11f 0x394efecf 0x394efdc1 0x394f091d 0x394f0ac1 0x39520a11 0x395208a4) libc++abi.dylib: terminate called throwing an exception

Was it helpful?

Solution

I had this problem and it was coming from the fact that my app, for testing purposes, was clearing the cache directory when loading the view controller where the profilepictureview was loaded.

When I disabled that, everything worked perfectly !

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top