【发布时间】:2016-01-20 11:05:55
【问题描述】:
我必须处理这样的字典,或者更多嵌套。 如何访问“twotwo”之类的字段?或者有没有更好的可能性来模拟这种结构?
let nestedDict = [
"fieldOne": "name",
"fieldTwo": "name",
"fieldThree":
[
[
"twoOne": "some text",
"twoTwo": true,
"twoThree": 1e-40
],
[
"twoOne": "some text",
"twoTwo": true,
"twoThree": 1e-40
]
]
]
【问题讨论】:
-
你试过
nestedDict["fieldThree"]["twoTwo"]吗? -
嵌套Dict["fieldThree"][0][0]["twoTwo"]之间有一些数组会失败
标签: ios swift dictionary nested