Re: how to create a NSMenuItem without memory leaks
Re: how to create a NSMenuItem without memory leaks
- Subject: Re: how to create a NSMenuItem without memory leaks
- From: Greg Parker <email@hidden>
- Date: Mon, 16 May 2011 19:05:59 -0700
On May 16, 2011, at 6:16 PM, Nick Zitzmann wrote:
> On May 16, 2011, at 5:49 PM, Conrad Shultz wrote:
>>
>> On 5/16/11 4:04 PM, Martin Batholdy wrote:
>>> Hi,
>>>
>>> I create an NSMenu by myself;
>>>
>>> menu = [[NSMenu allocWithZone:menuZone] init];
>>
>> What Nick said.
>>
>> Plus, you almost never want to use -allocWithZone:. Zones are a
>> particularly arcane subject and explicit determination of a zone is best
>> avoided.
>
> That's not true with NSMenu; the OP actually had it right: <http://developer.apple.com/library/mac/documentation/Cocoa/Reference/ApplicationKit/Classes/NSMenu_Class/Reference/Reference.html#//apple_ref/doc/uid/20000267-menuZone>
Don't bother. The menu zone is gone as of Snow Leopard. -setMenuZone: does nothing, and -menuZone always returns the default malloc zone.
--
Greg Parker email@hidden Runtime Wrangler
_______________________________________________
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