• 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
Mutable dictionaries in NSUserDefaults?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Mutable dictionaries in NSUserDefaults?


  • Subject: Mutable dictionaries in NSUserDefaults?
  • From: Jonathan del Strother <email@hidden>
  • Date: Fri, 28 Oct 2005 00:35:17 +0100

I've added an NSMutableDictionary called "FileDates" into my NSUserDefaults. I was hoping to access it with something like this :

[[NSUserDefaults standardUserDefaults] setValue:fileDate forKeyPath:@"FileDates.SomeFile"]

...but this raises an exception - "-[NSCFDictionary setObject:forKey:]: mutating method sent to immutable object"


Is the mutable dictionary converted to immutable on entering it into the user defaults? Does this mean that whenever I update a file date property, I have to extract the immutable dictionary, make a mutable copy, add the new file date, and re-enter it into user defaults, or is there a better way?



Jon


_______________________________________________ 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
  • Prev by Date: Text attachments - making an NSTextAttachment unique?
  • Next by Date: Re: Getting User and Process Information
  • Previous by thread: Re: Text attachments - making an NSTextAttachment unique?
  • Next by thread: NSRulerView's style pulldown.
  • Index(es):
    • Date
    • Thread