• 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: Cocoa class extension best practice
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Cocoa class extension best practice


  • Subject: Re: Cocoa class extension best practice
  • From: "Gary L. Wade" <email@hidden>
  • Date: Tue, 15 Oct 2013 15:26:23 -0700
  • Thread-topic: Cocoa class extension best practice

On 10/15/2013 2:39 PM, "Steve Mills" <email@hidden> wrote:


>I don't think this is the case. I was seeing hundreds of still-alive
>allocated objects that came from the copied itemArray.

Ah, so within Instruments, are you looking at the objects that are
allocated or the objects that are leaking?  Those are two separate
classifications.

It is quite possible what you are getting back is the same immutable array
that NSMenu uses to manage its own items, and if that's the case, I'd
expect that same array to stick around for as long as the menu itself
sticks around without any modification.

In other words, you can't assume that every time you call -itemArray you
will get a new immutable array, but it's not a bad practice to operate as
though you would.
--
Gary L. Wade
http://www.garywade.com/



_______________________________________________

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


References: 
 >Re: Cocoa class extension best practice (From: Steve Mills <email@hidden>)

  • Prev by Date: Re: Cocoa class extension best practice
  • Next by Date: Re: Cocoa class extension best practice
  • Previous by thread: Re: Cocoa class extension best practice
  • Next by thread: Re: Cocoa class extension best practice
  • Index(es):
    • Date
    • Thread