CALayer removeFromSupeLayer crashes
CALayer removeFromSupeLayer crashes
- Subject: CALayer removeFromSupeLayer crashes
- From: Dennis Christopher <email@hidden>
- Date: Fri, 9 Jan 2009 15:19:26 -0500
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.)
Dennis Christopher
_______________________________________________
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