相信大家使用JSPatch的时候会遇到数据解析的问题,话不多说,直接贴代码
将如下json解析出来
data = {
soldArr = (
{
createtime = 1524468462000;
id = 8ba1141f19e74756ae10c4ad0bca9d06;
"img_minus" = "http://qiniu.yuzhilai.com/album/img_minus/1522635148685";
name = "\U7f8e\U5bb9\U9662\U8001\U677f\U6cd5\U5f8b\U5fc5\U4fee\U8bfe";
type = "\U4e13\U8f91";
},
{
createtime = 1524468391000;
id = e83adffdd71f4c6ca58d3077cb39c24b;
"img_minus" = "http://qiniu.yuzhilai.com/album/img_minus/1524124062231";
name = "\U7f8e\U5bb9\U9662\U793c\U4eea\U6807\U51c6\U5fc5\U4fee\U8bfe";
type = "\U4e13\U8f91";
}
)
}
var soldarr=data.jsonDict("data").jsonArray("soldArr") ;//iOS 里我自己写的方法
var tempArr= soldarr.toJS();//将arr转换成js类型
for (var i = 0; i < soldarr.count(); i ++) {
var dd=tempArr[i];//获取dic
var name =dd["name"];//在这里接收dictionary里的数据
}