Skip navigation.
 
mlNSenu and memory ownership
FROM : Wesley Smith
DATE : Fri Jul 25 18:28:23 2008

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

Related mailsAuthorDate
mlNSenu and memory ownership Wesley Smith Jul 25, 18:28
mlRe: NSenu and memory ownership Caleb Strockbine Jul 25, 21:05
mlRe: NSenu and memory ownership Wesley Smith Jul 25, 22:07
mlRe: NSenu and memory ownership I. Savant Jul 26, 06:09