• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
CALayer removeFromSupeLayer crashes
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: CALayer removeFromSupeLayer crashes
      • From: Corbin Dunn <email@hidden>
    • Re: CALayer removeFromSupeLayer crashes
      • From: David Duncan <email@hidden>
  • Prev by Date: changeKeyPath method documentation
  • Next by Date: accessing ivars in - (id)init
  • Previous by thread: Re: changeKeyPath method documentation
  • Next by thread: Re: CALayer removeFromSupeLayer crashes
  • Index(es):
    • Date
    • Thread