Note that there are some explanatory texts on larger screens.

plurals
  1. POCALayer -display method not being called
    primarykey
    data
    text
    <p>I'm building a picture book for the iPad with CoreAnimation. I did something like a Sprite class (a CALayer subclass) in order to be able to load my animation frames from a sprite sheet. Something similar than here: <a href="http://mysterycoconut.com/blog/2011/01/cag1/" rel="nofollow">http://mysterycoconut.com/blog/2011/01/cag1/</a>. I'm not using the layer's delegate in order to set the bounds and contentsRect (and in my case, also the position), but I'm doing it directly in the -display method of the CALayer subclass. </p> <p>I created a dummy and it was working perfectly. When I moved the code into my project, the -display method of my subclass doesn't get called anymore. I have read the documentation of the CALayer and the CoreAnimation Programming Guide tons of times and I can't find any information about when the -display method is being called. I only know that it uses the Template Pattern, that means, I shouldn't call it myself but instead [layer setNeedsDisplay] should be called, which calls the -display method itself. I tried doing this as well, without success. </p> <p>If you need to see some code, let me know. </p> <p>Any ideas?</p> <p><strong>UPDATE</strong></p> <p>I found the reason why the method wasn't being called. It's so embarrassing that it's not worth mentioning :0. Anyway, I would be still interested to know when exactly the -display method is being called. I noticed that I have to create an animation in order for it to be triggered. If I just added the layer to the display hierarchy with [layer addSublayer:myCustomLayer], the method didn't get called.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload