CALayer and Memory Management
CALayer and Memory Management
- Subject: CALayer and Memory Management
- From: Dimitri Bouniol <email@hidden>
- Date: Sun, 14 Dec 2008 17:08:06 -0800
I'm at a loss when it comes to releasing CALayers. Since you can only
create a layer with [CALayer layer] (docs advise not to use [[CALayer
alloc] init]), I would assume that the instance is automatically
qutoreleased. However, after looking through apple's sample code on a
menu built with core animation, the layers were autoreleased in the
dealloc method (this doesn't work too well if the layers aren't
instance variables). Additionally, when I tried releasing the layers
after I was done with them (after I added them to a superlayer),
sometimes it would freak out and crash, and other times it wouldn't
mind.
Basically, here's my question: When (if ever) are you supposed to
(auto)release CALayers?
--
定魅刀利
Dimitri Bouniol
email@hidden
http://www.appkainime.com/
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden