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

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

如何在 Swift 中優雅地處理 JSON

如何在 Swift 中優雅地處理 JSON

Cats萌萌 2019-04-05 03:02:25
如何在 Swift 中優雅地處理 JSON
查看完整描述

4 回答

?
收到一只叮咚

TA貢獻1821條經驗 獲得超5個贊

[
{
......
"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-04-06
?
陪伴而非守候

TA貢獻1757條經驗 獲得超8個贊

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-04-06
  • 4 回答
  • 0 關注
  • 778 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

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

幫助反饋 APP下載

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

公眾號

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