Re: Defaults not sync'ing?
Re: Defaults not sync'ing?
- Subject: Re: Defaults not sync'ing?
- From: email@hidden
- Date: Wed, 28 Dec 2005 22:37:22 -0800
Maybe call [defs synchronize] before pulling the prefs out in the
other process?
Not just from the prefpane...
Just a guess...
Andre
Joachim wrote:
I have a system prefs pane which writes its settings to the
defaults database using the code below. It then notifies another
process about the change, but when that process reads the
dictionary, it is the previous, cached, version that is being read.
NSUserDefaults *defs = [NSUserDefaults standardUserDefaults];
NSDictionary *prefs = [[NSDictionary alloc] initWithObjectsAndKeys:
Object-1, @"Key-1",
...
Object-n, @"Key-n",
nil];
[defs removePersistentDomainForName:bundleId];
[defs setPersistentDomain:prefs forName:bundleId];
[defs synchronize];
I've checked that the values are written correctly to the plist
file and that the sequence of events is correct. What am I doing
wrong?
I'm on Tiger, Xcode 2.2.
Thanks in advance,
Joachim
_______________________________________________
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
_______________________________________________
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