NSDictionary to JSON
priore Apr 4th, 2014 495 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- NSDictionary *dict = [NSDictionary new]; // source
- NSData *json_data = [NSJSONSerialization dataWithJSONObject:dict options:NSJSONWritingPrettyPrinted error:nil];
- NSString *json = [[NSString alloc] initWithData:json_data encoding:NSUTF8StringEncoding];
- NSLog(@"%@", json);
RAW Paste Data