• 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: Stupid objective-c question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Stupid objective-c question (From: Gabriel Zachmann <email@hidden>)
 >Re: Stupid objective-c question (From: Graham Cox <email@hidden>)
 >Re: Stupid objective-c question (From: Quincey Morris <email@hidden>)
 >Re: Stupid objective-c question (From: Graham Cox <email@hidden>)
 >Re: Stupid objective-c question (From: Jens Alfke <email@hidden>)
 >Re: Stupid objective-c question (From: Jeff Evans <email@hidden>)
 >Re: Stupid objective-c question (From: Jens Alfke <email@hidden>)
 >Re: Stupid objective-c question (From: Jeff Evans <email@hidden>)

  • Prev by Date: Re: Stupid objective-c question
  • Next by Date: Re: Stupid objective-c question
  • Previous by thread: Re: Stupid objective-c question
  • Next by thread: Re: Stupid objective-c question
  • Index(es):
    • Date
    • Thread