CALayer not obeying object ownership rules?

Posted by eaigner on Stack Overflow See other posts from Stack Overflow or by eaigner
Published on 2010-04-22T09:21:42Z Indexed on 2010/04/22 9:23 UTC
Read the original article Hit count: 192

Filed under:
|
|

I have a custom CALayer - UIProgressLayer - for simulating a progress bar. There is a dispatched GC timer involved to animate its intermediate state. So thats the layer I'm talking about here, although i don't think the problem is restricted to this particular subclass because a CALayer with only the -release and -dealloc overridden produces the same outcome.

The problem is when i send this layer, for instance, a

theLayer.opacity = 0.5f

a -release message is sent to the layer, thus deallocating my layer. Why is this happening? Has it something to do with how the whole CA system works? But it still has to obey the object ownership rules right?

I was thinking maybe it creates a copy of that layer for the fading, but that's not the case.

© Stack Overflow or respective owner

Related posts about cocoa

Related posts about core-animation