1.字典-->字符串
- NSData *jsonData = [NSJSONSerialization dataWithJSONObject:dic options:NSJSONWritingPrettyPrinted error:&parseError];
- NSString *string = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
2.1NSString --> char *
- char *charType = [string cStringUsingEncoding:NSASCIIStringEncoding];
2.2.char * -->NSString
- NSString *string_content = [[NSString alloc] initWithCString:(const char*)char encoding:NSASCIIStringEncoding];
时间: 2024-10-29 19:06:52