EnjoySR / ESJsonFormat-Xcode

将JSON格式化输出为模型的属性
MIT License
2.13k stars 350 forks source link

下面这个类型的数据怎么转换? 内部有字典的 #80

Closed ZengSir closed 8 years ago

ZengSir commented 8 years ago

{ "name": "王五", "gender": "man", "age": 15, "height": "140cm", "addr": { "province": "fujian", "city": "quanzhou", "code": "300000" }, "你好": [ { "name": "billiards", "code": "1" }, { "name": "computerGame", "code": "2" } ] }

EnjoySR commented 8 years ago

内部的字典也会生成对应的类的

ZengSir commented 8 years ago

但是这个内部的字典 的key 也是变化的, 而且是中文。 生成之后,就会出现如下代码: @property (copy, nonamic) NSString *你好; 如果方便的话,你转换试一下。

我遇到的实际问题是,后台返回的数据如下: {"Value":true,"Detail":{"免费兑换":{"免费兑换":[{"ParentSortName":"免费兑换","SubSortName":"免费兑换"}]},"幸运抽奖":{"1元":[{"ParentSortName":"幸运抽奖","SubSortName":"1元"}],"免费":[{"ParentSortName":"幸运抽奖","SubSortName":"免费"}]}},"ErrorMessage":null,"OtherMessage":null}

格式化后如下:

32740bb8-75b0-11e6-81d3-4a320e516f54