//UIImage 转为 NSData
NSData *imageData = UIImagePNGRepresentation(aImage);
//NSData 转为 UIImage
UIImage *newImage = [UIImage imageWithData:imageData];
//UIImage 转为 NSData
NSData *imageData = UIImagePNGRepresentation(aImage);
//NSData 转为 UIImage
UIImage *newImage = [UIImage imageWithData:imageData];
转载于:https://www.cnblogs.com/shidaying/p/4203262.html