标签:sda container span options 开发 var ted read 转换
1.字符串转字典
NSString * jsonString = @"";
NSData *jsonData = [jsonString dataUsingEncoding:NSUTF8StringEncoding];
NSDictionary *dic = [NSJSONSerialization JSONObjectWithData:jsonData options:NSJSONReadingMutableContainers error:&err];
2.字典转字符串
SData *jsonData = [NSJSONSerialization dataWithJSONObject:dic options:NSJSONWritingPrettyPrinted error:&parseError];
NSString * str = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
标签:sda container span options 开发 var ted read 转换
原文地址:http://www.cnblogs.com/danMing-love/p/7240162.html