First of all, im finding the iPhone online docs to be not-so-very thoroughly clear when it comes to the various ways of rendering a layer. I get the jist of it, but im not clear when to use which methods and which requires the layer to be added as a sub layer or not.
My project started off trivially with me loading images and simply drawing them to a UIView via [image drawAtPoint:] as well as [image drawInRect:]. These work fine using the current graphics context.
Then today i happened to read this concept of using layers so that animating my various images (implicitly) would in theory be a breeze!
For the record, i know the docs say subclassing CALayer is unecessary, but i did just that. Now I am incredibly confused about the different ways to supposedly render a layer.
- drawLayer
- displayLayer
- display
- drawInContext
Now for all of these methods, is it required to set the layer's frame size? Is it required to add a layer to a view's layer?
The only method that gives me visible results is the drawinContext method. But if i apply an implicit animation (e.g. image.opacity = 0) nothing happens, which makes me believe my layer is not properly set up.
Some one please bring order back to this chaos.