//String转data
NSData *data1 = [self.name.sublabel.text dataUsingEncoding:NSUTF8StringEncoding];
1、NSData 转NSString
NSString *result =[[ NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
//data进行base64编码
NSString *stringBase64 = [data base64Encoding];
网友评论