解析响应的Facebook的iOS SDK
问题描述:
你能不能帮我正确解析响应: 分析器在 - (空)要求:(FBRequest *)要求didLoad:(ID)结果:解析响应的Facebook的iOS SDK
case education:{
NSArray *arrayRsult = [[result objectForKey:@"education"] objectForKey:@"school"];
for (NSDictionary *placeForResults in arrayRsult){
NSString *output = [placeForResults objectForKey:@"name"];
NSLog(@"%@", output);
}
}
break;
我的要求:
- (IBAction)eduacation:(id)sender {
currentApiCall = education;
FacebookInfoGetterAppDelegate *delegate = (FacebookInfoGetterAppDelegate *) [[UIApplication sharedApplication] delegate];
[[delegate facebook] requestWithGraphPath:@"me?fields=education" andDelegate:self];
}
但它返回数组与空值。怎么了?
答
首先你需要设置权限如此 - “user_education_history”
我纠正代码为您解析部分,因为你有重要的教育收到字典,包括你的学校的阵列。
NSArray *arrayRsult = [result objectForKey:@"education"];
for (NSDictionary *placeForResults in arrayRsult){
NSString *output = [[placeForResults objectForKey:@"school"] objectForKey:@"name"];
NSLog(@"%@", output);
}
它适合我。
谢谢! Loks太棒了! – Yaz