Skip navigation.
 
mlRe: NSenu and memory ownership
FROM : Wesley Smith
DATE : Fri Jul 25 22:07:29 2008

> Removing a menu with -removeItem: or -removeItemAtIndex: doesn't return
> anything, and in any case you didn't alloc, copy, or retain anything, so you
> don't have to worry about releasing anything.


While this is true, I'm using - (NSMenuItem *)itemWithTitle:(NSString
*)aString to get the item if it exists and using that pointer from
then on out instead of replacing it.  So, let's say I want to modify
the File menu, if I have a pointer to it when the app closes, should I
be worried about freeing it if it was generated from a nib file and
not procedurally by me in the code?

thanks,
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