SwiftyJSON遍历JSON对象数组 [英] SwiftyJSON looping through an array of JSON objects
本文介绍了SwiftyJSON遍历JSON对象数组的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
[
{
"cont": 9714494770,
"id": "1",
"name": "Kakkad"
},
{
"cont": 9714494770,
"id": "2",
"name": "Ashish"
}
]
上面的一个是一个填充有JSON对象的json数组.我不知道该如何使用SwiftyJSON解析
The one above is a json array filled with JSON objects. I don't know how to parse through this with SwiftyJSON
推荐答案
SwiftyJSON 页面中的示例,适用于您的数据:
Example from the SwiftyJSON page, adapted to your data:
let json = JSON(data: dataFromNetworking)
for (index, object) in json {
let name = object["name"].stringValue
println(name)
}
这篇关于SwiftyJSON遍历JSON对象数组的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文