My presentation layer does not match my model layer even though I have no animations

Posted by Kevin McCullough on Stack Overflow See other posts from Stack Overflow or by Kevin McCullough
Published on 2010-04-05T13:41:19Z Indexed on 2010/04/05 13:43 UTC
Read the original article Hit count: 379

Filed under:
|
|
|
|

On iPhone I have a CALayer that I animate via Core Animation. Then at some point I change view controllers. I then return to the view controller with the CALayer and in viewWillAppear: I set the frame and position properties on my layer to move it back to its starting point.

Setting these properties changes the model layer but the presentation layer still has the old values and its presentation layer does not update until the next animation I play.

In the CA Programming guide it says "You can query an instance of CALayer for its corresponding presentation layer while an animation transaction is in process." Which, to me, implies that the presentation layer should only be different from the model layer during an animation. But there are no animations currently running. I even used kCATransactionDisableActions to ensure that when I set the position property an implicit animation is not started.

Does anyone know why my presentation and model layers are out of sync?

Thanks.

© Stack Overflow or respective owner

Related posts about core

Related posts about animation