Q:

How to fix the Core Foundation object with a +1 retain count (ARC)?

Here is my method:
CVImageBufferRef imageBuffer = CMSampleBufferGetImageBuffer(aSampleBuffer);

CIImage *ciImage = [CIImage imageWithCVPixelBuffer:imageBuffer];

CIContext *context = [CIContext contextWithOptions:nil];
CGImageRef myImage = [context
                      createCGImage:ciImage
                      fromRect:CGRectMake(0, 0,
                                          CVPixelBufferGetWidth(imageBuffer),
                                          CVPixelBufferGetHeight(imageBuffer))];

return [UIImage imageWithCGImage:myImage];

But last line show me is Potential leak of an object stored into 'myimage', and the line of myImage is Method returns a Core Foundation object with a +1 retain count. But my application is ARC enabled, so I can't release something. How can I fix it? Thanks. 

A:

UIImage *retVal = [UIImage imageWithCGImage:myImage];
CGImageRelease(myImage);
return retVal;

A:

My application is ARC enabled, so I can't release something

Wrong. ARC prevents you from sending the release message to Objective-C objects, since it manages their memory for you.
However you still have to manually manage the memory in any other case (i.e. C structures). You can - and must - use retain/release functions on such structures whenever appropriate.
In this case you have to manually call CGImageRelease on myImage, balancing the retain count, by doing (as proposed by H2CO3)
    UIImage *retVal = [UIImage imageWithCGImage:myImage];
    CGImageRelease(myImage);
    return retVal;

