How to parse this Flickr answer?

I get this from the Flickr response sample on my api site:

jsonFlickrApi({"method":{"_content":"flickr.test.echo"}, "format":{"_content":"json"}, "api_key":{"_content":"8038f7f7d7151ccbf6df2aa10b1b35ae"}, "stat":"ok"}) 

I see a dictionary there, right after the words jsonFlickApi. But how do I get rid of this leading text and put the dictionary in my NSDictionary?

+6
source share
1 answer

Use the NSJSONSerialization class to parse JSON data.

Edit: jsonFlickrApi(...) indicates that you are using the JSONP endpoint to communicate with Flickr. You do not need it; a simple JSON endpoint is fine. According to this Flickr API documentation , you can fix this by turning on the nojsoncallback parameter with a value of 1 when you make your request.

+13
source

All Articles