[__NSCFDictionary objectAtIndex:]: unrecognized selector sent to instance

前端 未结 2 958
情深已故
情深已故 2020-11-27 23:48

I am trying to parse a Json file into the Table view and I am getting this error

[__NSCFDictionary objectAtIndex:]: unrecognized selector sent to instance and the ap

相关标签:
2条回答
  • 2020-11-28 00:31

    The problem is that feed is not a NSArray, but a NSDictionary.

    Looking at the JSON, you likely want to access this array: [feed objectForKey:@"entry"]

    0 讨论(0)
  • 2020-11-28 00:39

    The top level object in your feed is a JSON object, not a JSON array. So the deserialisation gives you an NSDictionary, not an NSArray.

    0 讨论(0)
提交回复
热议问题