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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to