: ImageIO: CGImageReadCreateDataWithMappedFile...error = 2 (No such file or directory)

BUG出现描述
: ImageIO: CGImageReadCreateDataWithMappedFile 'open' failed '路径'
error = 2 (No such file or directory)

[BUG原因]
原因:保存时,图片已被删除
解决方案:从路径读取图片后,先转换成NSData,再生成一张新的image.

UIImage*tempImage = [[UIImagealloc]initWithContentsOfFile:path];
NSData*tempData = UIImageJPEGRepresentation(tempImage,1.0);
UIImage*newImage = [UIImageimageWithData:coverData];

你可能感兴趣的:(: ImageIO: CGImageReadCreateDataWithMappedFile...error = 2 (No such file or directory))