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保存就不會出現問題了。