I am having trouble with getting a UIImage from and CIImage. The line of code below works fine on iOS6: (Output image is an CIImage)
self.imageView = [UIImage imageWithCIImage:outputImage];
or
[self.imageView setImage:[UIImage imageWithCIImage:outputImage]];
When I run this same line of code on a device that is running iOS 5 the imageView is blank. If I log the size property of the UIImage it is correct but the image never displays on the screen.
When I use a CGImageRef (as shown below) it works fine on both devices but it causes huge memory growth when I do a heap shot analysis.
context = [CIContext contextWithOptions:nil];
CGImageRef ref = [context createCGImage:outputImage fromRect:outputImage.extent];
self.imageView.image = [UIImage imageWithCGImage:ref scale:1.0 orientation:UIImageOrientationUp];
CGImageRelease(ref);
Does anyone know why UIImage imageWithCIImage does not work? According to the UIImage class reference it should work on iOS5 and above. Also why does using CGImageRef cause such massive heap growth?
Thank you