I have this code:
CGImageRef imageRef = CGImageCreateWithImageInRect([image CGImage], rect);
UIImage *outputimage = [UIImage imageWithCGImage:imageRef
scale:image.scale
orientation:UIImageOrientationUp];
and I get the warning:
Object leaked: object allocated and stored into 'imageRef' is not referenced later in this execution path and has a retain count of +1
But I am using ARC and cannot use release
or autoRelease
. How to resolve this?