NSData与UIImage之间的转换

NSData *imageData = [NSData dataWithContentsOfFile: imagePath];
UIImage *aimage = [UIImage imageWithData: imageData];
 //UIImage-> NSData
NSData *imageData = UIImagePNGRepresentation(aimae);
原文地址:https://www.cnblogs.com/lzxpythonhome/p/3120787.html