【发布时间】:2017-03-17 19:54:56
【问题描述】:
我正在使用 swift 解析 JSON。我来到一本返回空的字典。我将如何将其解析为自定义对象?
** 我在看Image**
},
"name": "Al bake",
"image": {},
"website": "",
"category": {
"id": "d59d2b1c-ca37-4c76-bb93-1c0ba967ee84",
"name": "Test Category",
"slug": "test-category",
"is_active": true
},
【问题讨论】:
-
为什么需要解析它?
-
我只是想学习如何做到这一点=]
-
你的image key只是一个空字典,你问的是如何解析json数据?
-
正确。我将如何为它创建一个结构或类?像自定义对象?