JSON响应:
{
"matches": [
{
"platformId": "EUW1",
"gameId": 3427082245,
"champion": 21,
"queue": 450,
"season": 9,
"timestamp": 1511224973899,
"role": "NONE",
"lane": "MID"
}
],
"startIndex": 0,
"endIndex": 1,
"totalGames": 136
}
序列化:
let myJsonMatchList = try JSONSerialization.jsonObject(with: content, options: JSONSerialization.ReadingOptions.mutableContainers) as! <Array<Dictionary<String,Any>>
无法将 (0x10b693260) 类型的值__NSDictionaryM
转换为NSArray
(0x10b692dd8)。
问题在于 Array Dictionary String Any 用 AnyObject 替换它是可行的,但它不允许我从内部访问任何内容,即除了打印原始 Json 之外。
因为我被卡住了,这个序列化的正确结构是什么?