• 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
Re: CALayer removeFromSupeLayer crashes
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >CALayer removeFromSupeLayer crashes (From: Dennis Christopher <email@hidden>)

  • Prev by Date: Re: Getting the network Machine Icon
  • Next by Date: Re: NSTextField input validation
  • Previous by thread: Re: CALayer removeFromSupeLayer crashes
  • Next by thread: accessing ivars in - (id)init
  • Index(es):
    • Date
    • Thread