1.UIImage转换为NSData

NSData *data;
if (UIImagePNGRepresentation(image) == nil) {

            data = UIImageJPEGRepresentation(image, 1);

        } else {

            data = UIImagePNGRepresentation(image);
}

2.NSData转换为NSString

NSString *str=[[NSString alloc]initWithData:data];

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-27
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-08-10
  • 2022-12-23
  • 2021-11-15
  • 2021-12-17
相关资源
相似解决方案