NSData存储字节流
NSString *[email protected]"hello world!";
//编码
NSData *data=[str dataUsingEncoding:NSUTF8StringEncoding];
NSLog(@"%s",data.bytes);
//转换回来
NSString *newStr=[[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
时间: 2024-12-27 19:11:38