• 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: Greg Guerin <email@hidden>
  • Date: Tue, 27 Apr 2010 16:04:19 -0700

Bill Appleton wrote:

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?


You are not responsible for NSApplication's retention or release of menus. It alone is responsible for that.

You set more menus for NSApplication by calling its setMainMenu: method with a different set of menus. That's all you need to know, and all you need to do. What happens in NSApplication as a result of calling setMainMenu: is not your responsibility.

To get the current main menu, call NSApplication's mainMenu method. You could use this to get the current main menu, which you will not own unless you retain.

  -- GG

_______________________________________________

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


  • Prev by Date: Re: Fastest way to check for descendants of an object
  • Next by Date: Re: NSApplicationMain question
  • Previous by thread: Re: menu madness with retain count
  • Next by thread: Fastest way to check for descendants of an object
  • Index(es):
    • Date
    • Thread