Skip to content
mcgtts edited this page Feb 15, 2012 · 3 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