Re: NSUserDefaults causing me fits
Re: NSUserDefaults causing me fits
- Subject: Re: NSUserDefaults causing me fits
- From: Chris Parker <email@hidden>
- Date: Mon, 8 Sep 2003 19:47:37 -0700
Hi John,
I'm coming to this thread a little late, sorry about that...
On Sep 8, 2003, at 7:23 PM, John Timmer wrote:
Well, this happens despite a synchronize message, and even if the pref
file
hadn't previously existed (ie - everything I did with it was a change,
so it
should have written out). Maybe the problem is that I'm creating the
prefs
as a dictionary and handing it over all at once, so it doesn't see
things as
changed. I'll try keeping one key out of the dictionary and setting it
afterwards to see if that triggers a write out.
When you say you're "creating the prefs as a dictionary and handing it
over all at once" what do you mean by this? Note that you can't set up
an NSMutableDictionary, hand that over to defaults and then mutate the
dictionary and have those mutations be reflected - NSUserDefaults is
only aware of the top-level key/value pairs changing.
Another caveat: If you're using -[NSUserDefaults registerDefaults:] to
set these, we won't write those out - those are the fallback
preferences that are consulted if there is no value for that key in
NSUserDefaults already.
If you can, a code snippet might give us some more insight into what's
going on here.
.chris
--
Chris Parker
Cocoa Frameworks Engineer
Apple Computer, Inc.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.