I make this facebook request:
SLRequest *facebookRequest = [SLRequest requestForServiceType:SLServiceTypeFacebook
requestMethod:SLRequestMethodGET
URL:[NSURL URLWithString:@"https://graph.facebook.com/fql"]
parameters:[NSDictionary dictionaryWithObject:@"SELECT uid, name, pic_square FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1 = me())" forKey:@"q"]];
[facebookRequest setAccount:_facebookAccount];
[facebookRequest performRequestWithHandler:^(NSData* responseData, NSHTTPURLResponse* urlResponse, NSError* error) {
if(!error){
id json = [NSJSONSerialization JSONObjectWithData:responseData options:0 error:nil];
NSLog(@"%@", [json class]);
//NSCFDictionary. How can i get the data that's inside this?
}else{
NSLog(@"error fb");
}
}];
Any thoughts on how to retrieve the data inside the NSCFDictionary? I’ve tried [json valueforKey...] but nothing
Use NSDictionary’s
-objectForKey:method:Incidentally, it wouldn’t take much to figure out that a NSCFDictionary can be treated like a NSDictionary. Here’s one SO question that explains that: What is an NSCFDictionary? Once you know that, you can easily figure out how to deal with it by looking at the documentation for NSDictionary.