NSDictionaries and Nested JSON

落花浮王杯 提交于 2019-12-01 11:53:09

Try this:

NSDictionary* data= json[@"data"];
NSDictionary* from= [data[0] objectForKey: @"from"];
NSString* name= from[@"name"];

If you just want the name you're fine, if instead you need all the data, I suggest to create an object that is able to hold a value for every dictionary entry. You access to "id" and "category" the same way I shown, just using a different key.

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