• 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: From Panther to Tiger
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: From Panther to Tiger


  • Subject: Re: From Panther to Tiger
  • From: Bob Ippolito <email@hidden>
  • Date: Mon, 16 May 2005 16:25:09 -0400


On May 16, 2005, at 4:12 PM, Ondra Cada wrote:

On 16.5.2005, at 21:54, Bob Ippolito wrote:

Well, does it REALLY surprise you that when you ask an immutable container class to load itself from disk, you will get an immutable container back?


Nope, that's not the problem. The problem is that the *contained* object mutability gets lost in the process!


Does it, to paraphrase your very own words, NOT surprise you the following simple sample raises? Me, I was surprised all right. In my vocabulary, this is *WRONG*. But I've kind of got used to that with CoreData-based stuff :(((

No, it is NOT wrong, but your examples sure were :)

Property lists (in their entirety, not just the root object!) are not inherently mutable or immutable, the method you use to deserialize them has always determined whether they should be and contain mutable objects.

It just so happened that +[NSDictionary dictionaryFromFile:] used to load as mutable whether or not you asked it do, but it doesn't break API contract (because it's a bug if you send a mutation message to an immutable object).

If you wanted mutable objects, you should've always said + [NSMutableDictionary dictionaryFromFile:], or used NSPropertyListSerialization and asked explicitly.

-bob

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Re: From Panther to Tiger (From: Matt Neuburg <email@hidden>)
 >Re: From Panther to Tiger (From: Bob Ippolito <email@hidden>)
 >Re: From Panther to Tiger (From: Ondra Cada <email@hidden>)

  • Prev by Date: Different NSCells in one NSTableView/NSTableColumn
  • Next by Date: Re: From Panther to Tiger
  • Previous by thread: Re: From Panther to Tiger
  • Next by thread: Re: From Panther to Tiger
  • Index(es):
    • Date
    • Thread