IOS 系统方法 字典DIC 转 字符串NSString

+(NSString *)dicToJsonStr:(NSDictionary *)dic{
    NSError *parseError = nil;
    NSData *jsonData = [NSJSONSerialization dataWithJSONObject:dic options:NSJSONWritingPrettyPrinted error:&parseError];
    return [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
}

你可能感兴趣的:(IOS 系统方法 字典DIC 转 字符串NSString)