發(fā)現(xiàn)一個(gè)特別簡單的方法:
NSData* data = [NSJSONSerialization dataWithJSONObject:@{@"1":@"one"} options:NSJSONWritingPrettyPrinted error:nil];
NSString * str = [[NSString alloc]initWithData:data encoding:NSUTF8StringEncoding];
NSLog(@"%@",str);
發(fā)現(xiàn)一個(gè)特別簡單的方法:
NSData* data = [NSJSONSerialization dataWithJSONObject:@{@"1":@"one"} options:NSJSONWritingPrettyPrinted error:nil];
NSString * str = [[NSString alloc]initWithData:data encoding:NSUTF8StringEncoding];
NSLog(@"%@",str);