hi all,

i like to create some menus, set them as the main menu bar, then maybe
delete them, and create some more menus, use them, etc.

but i can't find any way to do this with cocoa

here is the problem

when you add a submenu (setSubMenu:forItem) the retain count on the submenu
goes up by one

but when you delete that item, or set its submenu to nil, the retain count
does not change

if you ever delete a menu that has a submenu you will get a crash, but there
is no way to unassociate the menu and the submenu

another problem: when you set the main menu bar  [NSApp setMainMenu:themenu]
the retain count on themenu goes up by a lot, i can't predict it, but maybe
4 or 5

if you set the main menu bar to nil the retain count does not change on the
original main menu

so given all this, i can't find a way to create and delete menus without
crashes or memory leaks

am i doing something wrong?



thanks

bill appleton
_______________________________________________

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