亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

如何在 Swift 中優雅地處理 JSON

如何在 Swift 中優雅地處理 JSON

眼眸繁星 2019-05-31 14:02:46
如何在 Swift 中優雅地處理 JSON
查看完整描述

4 回答

?
鳳凰求蠱

TA貢獻1825條經驗 獲得超4個贊

[
{
......
"text": "just another test",
......
"user": {
"name": "OAuth Dancer",
"favourites_count": 7,
"entities": {
"url": {
"urls": [
{
"expanded_url": null,
"url": "",
"indices": [
0,
26
],
"display_url": null
}
]
}
......
},
"in_reply_to_screen_name": null,
},
......]


 




查看完整回答
反對 回復 2019-06-01
?
侃侃爾雅

TA貢獻1801條經驗 獲得超16個贊

let jsonObject : AnyObject! = NSJSONSerialization.JSONObjectWithData(dataFromTwitter, options: NSJSONReadingOptions.MutableContainers, error: nil)
if let statusesArray = jsonObject as? NSArray{
if let aStatus = statusesArray[0] as? NSDictionary{
if let user = aStatus["user"] as? NSDictionary{
if let userName = user["name"] as? NSDictionary{
//Finally We Got The Name

}
}
}
}



查看完整回答
反對 回復 2019-06-01
  • 4 回答
  • 0 關注
  • 784 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號