Array of dictionaries + NSUserDefaultsController
Array of dictionaries + NSUserDefaultsController
- Subject: Array of dictionaries + NSUserDefaultsController
- From: Brent Gulanowski <email@hidden>
- Date: Thu, 21 Oct 2004 14:05:01 -0400
Hi,
I just read through this thread in the archives:
http://www.cocoabuilder.com/archive/message/cocoa/2003/12/23/75669
but it discusses the inverse of what I'm finding so I'd be thankful to
have my error pointed out.
Supposedly stuff coming back from user defaults is mutable, although
that's not what I'm experiencing with NSArrayController tied to an
array of dictionaries in NSUserDefaults. Existing elements, supposedly
immutable, are easily changeable. (I naively thought, previously, that
this depended on how I saved the array the first time, so I made the
array and the contained dictionaries mutable. Also, changing it from
immutable to mutable fixed an earlier problem ... is the info in that
discussion out of date?) This is not my problem.
My problem is that I'm adding to the array and trying to change the
new dictionary. But then I get the classic error: "-[NSCFDictionary
setObject:forKey:]: mutating method sent to immutable object". That's
confusing because I just created that new dictionary with
-[NSArrayController add:], and the controller's object setting is
"NSMutableDictionary".
This was working previously and I changed something you'd think was
unrelated, and now it's not working.
Thanks in advance.
--
Brent Gulanowski
http://www.boredastronaut.com
_______________________________________________
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