Skip to content
Gabriel Tomitsuka edited this page Feb 2, 2015 · 4 revisions

JSON string -> NSDictionary:

NSString *jsonString = @"{"foo": "bar"}";

NSDictionary *dictionary = [jsonString JSONValue];

NSLog(@ "Dictionary value for "foo" is "%@"", [dictionary objectForKey:@"foo"]);

NSDictionary -> JSON string:

NSString *newJSONString = [dictionary JSONRepresentation];

`

Clone this wiki locally