Re: Cocoa class extension best practice
Re: Cocoa class extension best practice
- Subject: Re: Cocoa class extension best practice
- From: Charles Srstka <email@hidden>
- Date: Wed, 16 Oct 2013 12:38:34 -0500
On Oct 16, 2013, at 11:57 AM, Steve Mills <email@hidden> wrote:
> So at this point, let's finish this thread by going back to my original question. Is it OK to use the private instance variable _itemArray in NSMenu since the methods we've added are *extensions* of NSMenu and not a subclass?
I wouldn't. If, in some OS update, Apple changes the NSMenu class such that the _itemArray ivar is no longer being used, your app would blow up horribly. Also, if Apple starts doing something like lazily populating that array or otherwise updating it at the time you ask for it, that won't get done if you access the ivar directly.
Charles
_______________________________________________
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