Reputation: 43
Could you help me to parse response correctly: Parser in - (void)request:(FBRequest *) request didLoad:(id)result:
case education:{
NSArray *arrayRsult = [[result objectForKey:@"education"] objectForKey:@"school"];
for (NSDictionary *placeForResults in arrayRsult){
NSString *output = [placeForResults objectForKey:@"name"];
NSLog(@"%@", output);
}
}
break;
My request:
- (IBAction)eduacation:(id)sender {
currentApiCall = education;
FacebookInfoGetterAppDelegate *delegate = (FacebookInfoGetterAppDelegate *) [[UIApplication sharedApplication] delegate];
[[delegate facebook] requestWithGraphPath:@"me?fields=education" andDelegate:self];
}
But it returns array with nulls. Whats wrong?
Upvotes: 1
Views: 1578
Reputation: 3303
first of all you need to set up rights for this - "user_education_history"
I corrected code for your parsing part because your receive dictionary with key education that consists array of your schools.
NSArray *arrayRsult = [result objectForKey:@"education"];
for (NSDictionary *placeForResults in arrayRsult){
NSString *output = [[placeForResults objectForKey:@"school"] objectForKey:@"name"];
NSLog(@"%@", output);
}
it works for me.
Upvotes: 1