views:

15

answers:

1

My project is composed by a PrefPane to set user defaults and a HelperApp that's running in background. Both are accessing the shared preferences plist file through CFPreferences functions.

Basically the HelperApp is a CFRunLoopSourceRef: when it's triggered by power source events, it reads user defaults from the preferences plist and reacts.

The problem, is the following: if I modify user defaults from the PrefPane when the HelperApp is running in background, it's not able to read the modified settings even if it seems to read the preferences plist every time it's triggered.

+1  A: 

Are you forcing a sync-to/from-disk? (Via CFPreferencesAppSynchronize or CFPreferencesSynchronize.)

Wevah
Yes sorry, I was syncing only after writing from PrefPane and not before reading from HelperApp.After spending the whole evening debugging, I was sure that the solution was simple but I was missing something...Thank you very much!
massimoperi