在 JSON 中:
[
{"Question_id": "Question 1",
"Strategies" : [
{"Strategy_id" : "Strategy 1",
"Tools" : [
{"Tool_id" : "Tool 1",
"Tool_attr" : "sharp" },
{"Tool_id" : "Tool 2",
"Tool_attr" : "dull" },
{"Tool_id" : "Tool 1",
"Tool_attr" : "green" }
]
},
{"Strategy_id" : "Strategy 2",
"Tools" : [
{"Tool_id" : "Tool 5",
"Tool_attr" : "pointy" },
{"Tool_id" : "Tool 6",
"Tool_attr" : "blunt" },
{"Tool_id" : "Tool 7",
"Tool_attr" : "red" }
]
}
},
{"Question_id": "Question 2",
"Strategies" : [
{"Strategy_id" : "Strategy 5",
"Tools" : [
{"Tool_id" : "Tool 1",
"Tool_attr" : "sharp" },
{"Tool_id" : "Tool 2",
"Tool_attr" : "dull" },
{"Tool_id" : "Tool 1",
"Tool_attr" : "green" }
]
},
{"Strategy_id" : "Strategy 6",
"Tools" : [
{"Tool_id" : "Tool 5",
"Tool_attr" : "pointy" },
{"Tool_id" : "Tool 6",
"Tool_attr" : "blunt" },
{"Tool_id" : "Tool 7",
"Tool_attr" : "red" }
]
}
]
这直接映射到 NSDictionary/Array 对象,其中{}
是字典和[]
数组。