nsdictionary获得指定key值
问题描述:
在nsdictionary中保存json解析的结果:
[plain]
{
"statusCode":"200",
"body":[
{
"status":"success",
"remarks":null
}
],
"data":[
"abcd":[
{
"category":"a",
"title":"b",
"id":"24"
},
{
"category":"c",
"title":"crd",
"id":"65"
},
{
"category":"ds",
"title":"sd",
"id":"18"
}
]
},
{
"efgh":[
{
"category":"ds",
"title":"sd",
"id":"18"
},
{
"category":"sd",
"title":"sd",
"id":"1"
}
]
},
{
"ijkl":[
{
"category":"ds",
"title":"sd",
"id":"18"
},
{
"category":"sd",
"title":"sd",
"id":"1"
}
]
}
]
}
{
"statusCode":"200",
"body":[
{
"status":"success",
"remarks":null
}
],
"data":[
"abcd":[
{
"category":"a",
"title":"b",
"id":"24"
},
{
"category":"c",
"title":"crd",
"id":"65"
},
{
"category":"ds",
"title":"sd",
"id":"18"
}
]
},
{
"efgh":[
{
"category":"ds",
"title":"sd",
"id":"18"
},
{
"category":"sd",
"title":"sd",
"id":"1"
}
]
},
{
"ijkl":[
{
"category":"ds",
"title":"sd",
"id":"18"
},
{
"category":"sd",
"title":"sd",
"id":"1"
}
]
}
]
}
关键字@data的数据可以保存在数组中:
[plain]
NSMutableArray *getdata=[[NSMutableArray alloc]init];
getcat=[results objectForKey:@"data"];
NSMutableArray *getdata=[[NSMutableArray alloc]init];
getcat=[results objectForKey:@"data"];
补充:移动开发 , IOS ,