NSData与UIImage之间的转换

//NSData转换为UIImage
NSData *imageData = [NSData dataWithContentsOfFile: imagePath];
UIImage *image = [UIImage imageWithData: imageData];


//UIImage转换为NSData
NSData *imageData = UIImagePNGRepresentation(aimae);

你可能感兴趣的:(ios,swift,NSData,uiimage)