• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: how to create a NSMenuItem without memory leaks
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: how to create a NSMenuItem without memory leaks


  • Subject: Re: how to create a NSMenuItem without memory leaks
  • From: Conrad Shultz <email@hidden>
  • Date: Mon, 16 May 2011 16:49:27 -0700

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

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.

There are (few) situations where you might actually want
- -allocWithZone:, but at this stage in your learning I advise you just
pretend zones don't exist.

- --
Conrad Shultz

Synthetiq Solutions
www.synthetiqsolutions.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iD8DBQFN0bgHaOlrz5+0JdURAh85AJ9VYe/7+hajavGYrtPz22IjvifkwACghPGm
1gRKOl8slESkEZqrOnI3dgM=
=MxJd
-----END PGP SIGNATURE-----
_______________________________________________

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

  • Follow-Ups:
    • Re: how to create a NSMenuItem without memory leaks
      • From: Nick Zitzmann <email@hidden>
References: 
 >how to create a NSMenuItem without memory leaks (From: Martin Batholdy <email@hidden>)

  • Prev by Date: Re: how to create a NSMenuItem without memory leaks
  • Next by Date: Re: how to create a NSMenuItem without memory leaks
  • Previous by thread: Re: how to create a NSMenuItem without memory leaks
  • Next by thread: Re: how to create a NSMenuItem without memory leaks
  • Index(es):
    • Date
    • Thread