Objective c 如何解析词典
我有一本字典,印刷时是这样的Objective c 如何解析词典,objective-c,Objective C,我有一本字典,印刷时是这样的 ( { "current_game" = 1; "fb_id" = 1; "game_status" = 1; }, { "current_game" = 4; "fb_id" = 2; "game_status" = 1; }, { "current_game" = "";
(
{
"current_game" = 1;
"fb_id" = 1;
"game_status" = 1;
},
{
"current_game" = 4;
"fb_id" = 2;
"game_status" = 1;
},
{
"current_game" = "";
"fb_id" = 3;
"game_status" = "";
},
{
"current_game" = "";
"fb_id" = 4;
"game_status" = "";\
}
)
当我像这样把它圈起来
for (int i=0; i < [responseDict count]; i++) {
}
for(int i=0;i<[responseDict count];i++{
}
例如,如何访问fb_id=1?objectAtIndex:我似乎不存在,那里也没有钥匙 谢谢,
啊,我知道怎么做了 因此,对于循环,请使用此选项
for (iNSDictionary *status in responseDict) {
}
这样,您就可以使用[status objectForKey:@“fb_id”]访问
谢谢,Tee请格式化您的代码,这很简单。为您解决了这个问题。有了473代表,你应该真正知道如何格式化你的帖子。这看起来更像是一系列字典。