嵌套json数据解析
category = (
{
children = (
{
id = 3;
name = "%E9%95%BF%E8%A2%96T%E6%81%A4";
parentid = 1;
},
{
id = 4;
name = "%E7%9F%AD%E8%A2%96T%E6%81%A4";
parentid = 1;
}
);
id = 1;
name = "%E7%94%B7%E8%A3%85";
},
{
children = (
{
id = 5;
name = "%E9%95%BF%E8%A2%96T%E6%81%A4";
parentid = 2;
}
);
id = 2;
name = "%E5%A5%B3%E8%A3%85";
},
{
id = 1001;
name = "%E5%AE%A0%E7%89%A9";
},
{
id = 1002;
name = "%E4%BA%BA%E7%89%A9";
},
{
id = 1003;
name = "%E7%89%A9%E5%93%81";
},
{
id = 1004;
name = "%E8%A3%85%E9%A5%B0";
}
);
NSDictionary* dicRoot = [SSParse JSONObjectWithData:data options:NSJSONReadingMutableContainers error:&error];
NSDictionary* dicContent = [dicRoot objectForKey:@"content"];
NSArray* arrCategory = [dicContent objectForKey:@"category"];
{
id = 4;
name = "%E7%9F%AD%E8%A2%96T%E6%81%A4";
parentid = 1;
}
);
id = 1;
name = "%E7%94%B7%E8%A3%85";
},
{
children = (
{
id = 5;
name = "%E9%95%BF%E8%A2%96T%E6%81%A4";
parentid = 2;
}
);
id = 2;
name = "%E5%A5%B3%E8%A3%85";
},
{
id = 1001;
name = "%E5%AE%A0%E7%89%A9";
},
{
id = 1002;
name = "%E4%BA%BA%E7%89%A9";
},
{
id = 1003;
name = "%E7%89%A9%E5%93%81";
},
{
id = 1004;
name = "%E8%A3%85%E9%A5%B0";
}
[解决办法]
断点调试看看,dicRoot ,dicContent里面分别是些什么内容