BUG出现描述
<Error>: ImageIO: CGImageReadCreateDataWithMappedFile 'open' failed '路径'
error = 2 (No such file or directory)
BUG出现操作还原
1.从本地沙盒读取图片,加载到UIimageViews上。
2.删除沙盒里的图片。
3.将UIImageView里的图片保存到本地沙盒时,BUG出现。
BUG出现原因解析与解决方法
UIImage *tempImage = [[UIImage alloc] initWithContentsOfFile:path];
NSData *tempData = UIImageJPEGRepresentation(tempImage, 1.0);
UIImage *newImage = [UIImage imageWithData:coverData];
这样用newImage保存就不会出现问题了。