Can't save CIImage to file on iOS without memory leaks
问题 The following snippet of code save a CIImage to disk using an UIImage . - (void)applicationWillResignActive:(UIApplication *)application { NSString* filename = @"Test.png"; UIImage *image = [UIImage imageNamed:filename]; // make some image processing then store the output CIImage *processedImage = [CIImage imageWithCGImage:image.CGImage]; #if 1// save using context CIContext *context = [CIContext contextWithOptions:nil]; CGImageRef cgiimage = [context createCGImage:processedImage fromRect