【发布时间】:2026-01-06 15:45:01
【问题描述】:
let responseJSON = try? JSONSerialization.jsonObject(with: data, options: [.allowFragments])
if let responseJSON = responseJSON as? [String:Any] {
if let tJsonObj = xResponse["d"] as? [[String:Any]] {
// not working here...
}
}
tJsonObj 变量没有得到我的 json 数组内容。 我的 json 看起来像这样:
{"d": "[{\"title\":\"xxx\",\"timestamp\":\"2017-10-16 23:53:40\"},{\"title\":\"Mein Test iPhone 7\",\"timestamp\":\"2017-10-17 18:16:24\"}]"}
希望有人能提供帮助 - 谢谢!
【问题讨论】:
标签: ios json swift parsing dictionary