On 10/15/2013 2:39 PM, "Steve Mills" <smi...@makemusic.com> 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 (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to