I want to set the contents of a CALayer
to an image. The CALayer
has a contents
property The documentation on that property says that "a layer can set this property to a CGImageRef to display the image as its contents." But the property takes an id
so in Xcode I get the following issue:
Semantic Issue: Incompatible pointer types assigning to 'id' from 'CGImageRef' (aka 'struct CGImage *')
How can I assign a CGImageRef
to the contents
property when it only takes an id
? What am I missing here?
CGImageRef
isn't anNSObject
and therefore can't be represented as anid
... right? What's actually happening in this cast? – Rockaway