• 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: Fritz Anderson <email@hidden>
  • Date: Tue, 27 Apr 2010 11:32:49 -0500

On 27 Apr 2010, at 10:28 AM, Bill Appleton wrote:

> 1) after i append an item i have created to a menu i have created, and i
> don't want to own the menu item any more, i should release the item so that
> the menu owns it
>
> 2) when i add a submenu i have created to a menu i have created, and i don't
> want to own the submenu any more, i should release the submenu so that the
> menu owns it
>
> 3) when i set the menus i have created for NSApp using setMainMenu then...
> what? who owns them? how do i set more menus for NSApp? how do i get NSApp
> to release the current set?

The "ownership" metaphor has this defect: It's not like property, which has only one owner at a time. The concept is, instead, "I need to keep a claim on this object, so it doesn't go away without my saying I'm done with it."

So -release doesn't _give_ ownership of the object to anything else. The "anything else" uses -retain or creation to _take_ ownership (maybe think of it as "responsibility") for the object if it is interested in it.

	— F

_______________________________________________

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: 
 >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>)

  • Prev by Date: Re: why doesn't the compiler complain?
  • Next by Date: Re: Fastest way to check for descendants of an object
  • Previous by thread: Re: menu madness with retain count
  • Next by thread: Re: menu madness with retain count
  • Index(es):
    • Date
    • Thread