如何在OSX上获取SLRequest返回的NSCFDictionary内的数据?

时间:2012-11-09 00:45:16

标签: objective-c facebook macos

我提出这个facebook请求:

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");
            }
     }];

有关如何检索NSCFDictionary内部数据的任何想法?我尝试了[json valueforKey...]但没有尝试

0 个答案:

没有答案