Re: CALayer removeFromSupeLayer crashes
Re: CALayer removeFromSupeLayer crashes
- Subject: Re: CALayer removeFromSupeLayer crashes
- From: Corbin Dunn <email@hidden>
- Date: Tue, 13 Jan 2009 09:18:08 -0800
On Jan 9, 2009, at 12:19 PM, Dennis Christopher wrote:
I attach a base layer to a custom view as follows:
[view setWantsLayer:YES];
then I add several layers with:
CALayer *layer = [CALayer layer];
layer.name = @"test";
[view.layer addSublayer:layer];
the view draws and each layer draws thru the designated drawRect
and drawLayer methods, and all this looks fine.
However, I have an action that removes all layers but this crashes on
removeFromSuperlayer:
NSArray *theLayers = [[self layer] sublayers];
for(CALayer *layer in sublayers) {
[layer removeFromSuperlayer];
I'm new to CALayer and at a loss as to what could be wrong with this.
Any suggestions would be appreciated.
(I've read through most of Dudney's Core Animation book but nothing
jumps out at me.)
I highly recommend *always* adding a symbolic breakpoint on
objc_exception_throw. It will help you debug issues like this faster.
corbin
_______________________________________________
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