Re: NSUserdefaults shared by 2 applications, not synchronized ?
Re: NSUserdefaults shared by 2 applications, not synchronized ?
- Subject: Re: NSUserdefaults shared by 2 applications, not synchronized ?
- From: Aurélien Hugelé <email@hidden>
- Date: Wed, 16 Feb 2005 12:14:24 +0100
Le 16 févr. 05, à 11:59, Pontus Ilbring a écrit :
On 2005-02-16, at 10.36, Aurélien Hugelé wrote:
hi everyone !
I have a GUI+Daemon application type, so it is in fact _2_ applications. The GUI App is used to modify some values, that are stored in the defaults.
The daemon app read those values, and take them in account to do its job.
I've used addSuiteNamed:@"com.MyApp.TheGUIPartOfMyApp" in the daemon app, so that the daemon can read the defaults of the GUI app. This works beautifully.
But i must have missed something because once launched, the daemon can read the defaults of the GUI, but if i modify the defaults from the GUI, the daemon still get the OLD values, before they were modified...
From the documentation:
"NSUserDefaults caches the information to avoid having to open the user’s defaults database each time you need a default value. The synchronize method, which is automatically invoked at periodic intervals, keeps the in-memory cache in sync with a user’s defaults database."
I have called synchronize, that is what the carbon call :
CFPreferencesAppSynchronize(CFSTR(")) do...
but the daemon defaults **caches** is not synchronized... this is what i want !
_______________________________________________
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