Re: Stupid objective-c question
Re: Stupid objective-c question
- Subject: Re: Stupid objective-c question
- From: Jens Alfke <email@hidden>
- Date: Wed, 21 Sep 2016 22:25:53 -0700
> On Sep 21, 2016, at 9:47 PM, Jeff Evans <email@hidden> wrote:
>
> One would have to init it with objects to be useful at all, and then it presumably would point to different data than another NSArray (even nonmutable) inited with objects.
Yup. Another fun fact is that the non-mutable classes all implement -copy as simply “return self”, since copying an immutable object is a no-op*.
Again, the mutable subclasses override -copy to make an actual copy.
—Jens
* aside from bumping the retain count, but I’m ignoring that because with ARC we no longer care about such things, right?
_______________________________________________
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