I recently started a new project using Automatic Reference Counting (ARC).
When I assigned the contents of a CALayer:
UIView* view = ...
UIImage* image = ...
view.layer.contents = image.CGImage
I got an error
Implicit conversion of a non-Objective-C pointer type ‘CGImageRef’ to ‘id’ is disallowed with ARC
Simply casting the CGImageRef to id hides the error, but I was wondering if the ARC still functions correctly then?
You should really check out the ARC videos from WWDC 2011. They are available on the developer site and open through iTunes. Especially:
Also, the ARC reference notes:
Both the reference notes and the videos discuss Core Graphics (et al) and how they work with ARC.
Specifically, look at the section called "Managing Toll-Free Bridging"
Jörg Jacobsen has a good summary overview of the bridging options as well: Managing Toll-free Bridging in an ARC’ed Environment.