NSenu and memory ownership
NSenu and memory ownership
- Subject: NSenu and memory ownership
- From: "Wesley Smith" <email@hidden>
- Date: Fri, 25 Jul 2008 09:28:23 -0700
Hi List,
I have a question regarding memory ownership and NSMenus. Let's say I
have an application with a nib file containing the usual menu items
like File, Edit, Window etc. If, during the execution of my app, I
swap out the Window menu with another NSMenu object generated during
runtime, who owns what memory. Do I take ownership of the NSMenu
object that used to be the Window menu and thus have to free it later?
Does the AppMenu NSMenu take ownership of the newly created Window
NSMenu, freeing me from having to free it? How does this play out?
I'm doing this on Tiger, so the GC stuff in Leopard doesn't come in to
play. I've read a good chunk of the menu related Cocoa docs, but
didn't find anything about this. Thanks for any help in advance.
wes
_______________________________________________
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