• 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: Mutating message sent to immutable object
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Mutating message sent to immutable object


  • Subject: Re: Mutating message sent to immutable object
  • From: Kyle Sluder <email@hidden>
  • Date: Sun, 01 Sep 2013 16:36:41 -0700

On Sep 1, 2013, at 1:41 PM, Greg Parker <email@hidden> wrote:

>
> You're not entirely left up to their whim. A return value whose declared type is immutable imposes restrictions on both sides:
> 1. You must not mutate the returned object.
> 2. The returned object will not be mutated behind your back by anyone else.

Sadly, the frameworks don't always live up to their end of the bargain on this one.

Sometimes their failure to do so is documented—see -[NSTextStorage string], for instance. But usually it’s not.

--Kyle Sluder

_______________________________________________

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


  • Follow-Ups:
    • Re: Mutating message sent to immutable object
      • From: Ken Thomases <email@hidden>
References: 
 >Re: Mutating message sent to immutable object (From: Greg Parker <email@hidden>)

  • Prev by Date: Re: Mutating message sent to immutable object
  • Next by Date: Re: Mutating message sent to immutable object
  • Previous by thread: Re: Mutating message sent to immutable object
  • Next by thread: Re: Mutating message sent to immutable object
  • Index(es):
    • Date
    • Thread