#pragma mark - 保存图片至沙盒(应该是提交后再保存到沙盒,下次直接去沙盒取)
- (void) saveImage:(UIImage *)currentImage withName:(NSString *)imageName {
NSData *imageData = UIImageJPEGRepresentation(currentImage, 0.5);
// 获取沙盒目录
NSString *fullPath = [[NSHomeDirectory() stringByAppendingPathComponent:@"Documents"] stringByAppendingPathComponent:imageName];
// 将图片写入文件
[imageData writeToFile:fullPath atomically:NO];
}
保存图片到沙盒
最新推荐文章于 2017-04-05 11:53:39 发布