Mutable dictionaries in NSUserDefaults?
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