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是这样的:Swift - 嵌套JSON中的分析数组对象不工作
{"d": "[{\"title\":\"xxx\",\"timestamp\":\"2017-10-16 23:53:40\"},{\"title\":\"Mein Test iPhone 7\",\"timestamp\":\"2017-10-17 18:16:24\"}]"}
我希望有人能帮助 - 谢谢!
看一看:https://stackoverflow.com/questions/41734982/parsing-nested-array-of-dictionaries-using-object-mapper/41735194#41735194 –