This all is driving me nuts.
I just integrated facebook in my iphone app.
After typing in my username and password in the login dialog this method is called.
- (void)request:(FBRequest*)request didLoad:(id)result {
if ([request.method isEqualToString:@"facebook.fql.query"]) {
NSLog(@"result %@",result);
NSArray* users = result;
NSLog(@"users %@",users);
NSDictionary* user = [users objectAtIndex:0];
NSString* name = [user objectForKey:@"name"];
self.facebookName = name;
if (_posting) {
[self postToWall];
_posting = NO;
}
}
}
But after this the app crashes most of the times and when I tried to log the “result” array it appears to be empty. Why is it so?
What should I do? Please suggest.
I got the reason for this.
This was due to the session getting lost frequently in between.
So I had to call [session resume] in the facebook login action event
and in this manner if at all the session is lost by any chance then the previous session is resumed and the “
result” does not appears to be nil in(void)request:(FBRequest*)request didLoad:(id)resultmethod.Hope this helps out those who are stuck in the same issue.