• 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: menu madness with retain count
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: menu madness with retain count


  • Subject: Re: menu madness with retain count
  • From: Scott Ribe <email@hidden>
  • Date: Tue, 27 Apr 2010 13:21:27 -0600

On Apr 27, 2010, at 12:58 PM, vincent habchi wrote:

> Yet, at the same time, you may want the dealloc: method to trigger some events. For example, if you have a CALayer that holds various sublayers, and that CALayer goes away, you may want all the sublayers to go away at the same time. Yet, this is impossible if some other object around locks a reference to the sublayers.

So what's the problem? If other objects are holding references to the sublayers, then they should no* go away. On the other hand, if your really need them to go away when the parent layer goes away, then other objects should not hold references to the sublayers. The sublayers will go away when no references to them exist any longer; it is the parent layer's responsibility to release the references it holds on them; it is other objects' responsibility to release any references they hold; it is your responsibility to determine whether or not other objects should ever hold references to the sublayers--and of course to manage (retain/release/autorelease) the references that you need.

> By the way, how are exactly multiple calls to [object autorelease] handled by the pool? Does this give rise to as many calls to release: as they are autorelease references stored, or does the pool directly adjust the retain count?

Why would you care?

--
Scott Ribe
email@hidden
http://www.elevated-dev.com/
(303) 722-0567 voice




_______________________________________________

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: menu madness with retain count
      • From: vincent habchi <email@hidden>
References: 
 >menu madness with retain count (From: Bill Appleton <email@hidden>)
 >Re: menu madness with retain count (From: Graham Cox <email@hidden>)
 >Re: menu madness with retain count (From: Bill Appleton <email@hidden>)
 >Re: menu madness with retain count (From: Jens Alfke <email@hidden>)
 >Re: menu madness with retain count (From: vincent habchi <email@hidden>)

  • Prev by Date: Re: menu madness with retain count
  • Next by Date: Re: menu madness with retain count
  • Previous by thread: Re: menu madness with retain count
  • Next by thread: Re: menu madness with retain count
  • Index(es):
    • Date
    • Thread