On Oct 16, 2013, at 12:45:49, Andy Lee <ag...@mac.com> wrote: > I still don't see what mutability has to do with it, but that's a side issue.
The mutability doesn't matter. I'm just emphasizing that the internal array is mutable and this is returning a COPY of that array (which happens to be immutable). > I would too. > > I suspect you can safely use the instance variable, but if you're concerned > about the fact that it's undocumented, or that Apple could in theory move it > to the @implementation so that it's no longer visible to your code, you can > accomplish the same using numberOfItems and itemAtIndex:, as I mentioned > earlier. Then you're using totally public API *and* this particular method > no longer instantiates any objects. Either way, I'd add a clarifying comment. That's a good point. I'm guessing the author of this code used itemArray simply because it was an easy way to use the new "in" for loop mechanism. -- Steve Mills office: 952-818-3871 home: 952-401-6255 cell: 612-803-6157 _______________________________________________ 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