1、NSData 转NSString
NSString *result =[[ NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
2、字符串转Data
NSString *str =@"jesfds";
NSData *data =[str dataUsingEncoding:NSUTF8StringEncoding];
1、NSData 转NSString
NSString *result =[[ NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
2、字符串转Data
NSString *str =@"jesfds";
NSData *data =[str dataUsingEncoding:NSUTF8StringEncoding];