Could not cast value of type '__NSArrayM' to 'NSDictionary'

荒凉一梦 提交于 2019-12-02 10:38:56

The root object in your data is an array, not a object (dictionary).

You need to dynamically decide how to handle your JSON depending on the deserialized object.

What it's telling you is that the JSON object that you're parsing is not a dictionary, it's an array. So if you change it so that you treat its value as an array instead of a dictionary, you'll be able to iterate over that.

You need to reevaluate your JSON to ensure that it's structured the way you think it is. It would also be useful if you posted the JSON that you're trying to parse so that we can see it's structure as well.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!