Objective-C Tips & Trick - Prioregroup.com
[Objective-C] NSDictionary to JSON
       
back

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);






Copyright © 1996-2018 Centro Studi Informatica di Danilo Priore. All rights reserved. P.I.10149810581.
prioregroup.com