我有一个NSDictionary中称为itemDict和打印从NSDictionary中获取密钥值与GOOGLEPLUS类
NSLog(@"itemDictValues:%@",itemDict);
输出是在该格式时:
itemDictValues:
GTLPlusPerson 0xab821e0:
{etag:""LTv_6IJISeUQGTVXLjMeOtebkoM/eup2crXcelmpMFKesXWlGkJjCiE"" kind:"plus#person" id:"1145282979128841" objectType:"person" displayName:"FirstName LastName" image:{url} url:"https://plus.google.com/1145282979128841"}
从这我需要提取对应的值到ID,displayName和url到我的NSString变量,在这种格式
profileId=1145282979128841;
Name=FirstName LastName;
Profilepic=https://plus.google.com/1145282979128841;
我该如何解决这个问题?
你说itemDict是一个NSDictionary,但它不会出现基于你说它不响应objectForKey。你可以在itemDict的设置方法上显示一些代码吗?它不是一个NSDictionary,而是一个GTLPlusPerson? –
NSMutableArray * friends = [NSMutableArray array]; for(NSDictionary * itemDict in peopleFeed.items) { SocialProfile * friend = [[SocialProfile alloc] initWithDictionary:itemDict socialMedia:kSocialMediaGooglePlus]; [friends addObject:friend]; } – Gamerlegend
GTLPlusPeopleFeed * peopleFeed,是如何定义peopleFeed的。 – Gamerlegend