我有一种将图像保存到文档目录的方法。看起来像这样:
+(void)saveImageInDocumentsDirectory:(UIImage *)image withImageName:(NSString *)name {
NSArray * paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString * basePath = ([paths count] > 0) ? [paths objectAtIndex:0] : nil;
NSData * binaryImageData = UIImagePNGRepresentation(image);
[binaryImageData writeToFile:[basePath stringByAppendingPathComponent:[NSString stringWithFormat:@"%@.png",name]] atomically:YES];
}
有没有办法为此添加一个完成块,它将在保存图像时运行?