我是iOS新手,我想解析數據,但它非常複雜,我不知道如何解析它。下面給出的是json數據。如何在iOS中解析複雜的json數據?
{
"response_code": 200,
"last_updated": {
"date": "2015-12-27",
"time": "01:32:13"
},
"trains": [
{
"train": {
"number": "04921",
"start_time": "04:45",
"name": "SRE-UMB MEMU SPECIAL",
"type": "HSP"
},
"dest": {
"code": "UMB",
"name": "AMBALA CANT JN"
},
"source": {
"code": "SRE",
"name": "SAHARANPUR"
}
},
{
"train": {
"number": "04922",
"start_time": "20:45",
"name": "UMB-SRE MEMU SPECIAL",
"type": "HSP"
},
"dest": {
"code": "SRE",
"name": "SAHARANPUR"
},
"source": {
"code": "UMB",
"name": "AMBALA CANT JN"
}
}
]
}
你的感覺是在這個複雜......你能不能詳細 –
'trains'是一個數組,'火車,蒸餾水和source'是字典 –
[檢查此鏈接](http://stackoverflow.com/questions/33123797/swift-could-not-cast-value-of-type-nscfarray-to-nsdictionary/33123953#33123953)更好的主意 –