如何循環遍歷目標c中的json [{first set of values},{data->children->data->body}
的這一部分?Json解析多個循環
JSON是
[
{
"kind": "Listing"
},
{
"kind": "Listing",
"data": {
"children": [
{
"data": {
"body": "body1"
}
},
{
"data": {
"body": "body2"
}
}
]
}
}
]
我當前的代碼是
m_ArrList=[[NSMutableArray alloc]init];
NSDictionary *infomation = [self dictionaryWithContentsOfJSONString:@"surveyquestion.json"];
NSArray *array=[infomation objectForKey:@"data"];
int ndx;
NSLog(@"%@",array);
for (ndx = 0; ndx < [array count]; ndx++) {
NSDictionary *stream = (NSDictionary *)[array objectAtIndex:ndx];
NSArray *string=[stream valueForKey:@"children"];
//i am stuck here
}
我怎麼在 「//我在這裏停留」 嗎?