NSData与UIImage之间的转换
NSData *imageData = [NSData dataWithContentsOfFile: imagePath];
UIImage *aimage = [UIImage imageWithData: imageData];
//UIImage-> NSData
NSData *imageData = UIImagePNGRepresentation(aimae);
转载于:https://www.cnblogs.com/inandroid/p/3669746.html