Convert JSON feed to NSDictionary Convert JSON feed to NSDictionary ios ios

Convert JSON feed to NSDictionary


With IOS5 you can use NSJSONSerialization for serializing the JSON.

NSDictionary *dictionary = [NSJSONSerialization JSONObjectWithData:data options:kNilOptions error:&error];


You can't just cast a string as a dictionary and expect it to parse the JSON. You must use a JSON parsing library to take that string and convert it into a dictionary.


I made a class that makes this task easier. It uses iOS 5's NSJSONSerialization. Clone it from github here.


matomo