Re: Mutating message sent to immutable object
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