displaying JSON data with the help of dictionaries and array

时光怂恿深爱的人放手 提交于 2019-12-02 13:59:26

Firstly, thanks for publishing your Flickr API key as-is! It will be super useful for me to perform identity theft some day.

Second, another big thanks for not having read the data you got back. It starts like this:

{"photos":{"page":1, "pages":1792, "perpage":100,
 ^^^^^^^^^^

So the object for the key photos is a dictionary, not an array, thus,

NSArray* photo_information = [flickr_json objectForKey:@"photos"];

is wrong. Did you mean this instead:

NSArray* photo_information = [[flickr_json objectForKey:@"photos"]
                               objectForKey:@"photo"];

? Also, below when you construct the human readable description,

[photo objectForKey:@"Owner"]

is wrong, it should be

[photo objectForKey:@"owner"]

instead.

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