Live updating user defaults from a prefpane to a running app
Live updating user defaults from a prefpane to a running app
- Subject: Live updating user defaults from a prefpane to a running app
- From: Shamyl Zakariya <email@hidden>
- Date: Wed, 14 Jul 2010 07:59:07 -0400
Hey everybody,
I'm in the very early stages of writing a headless app which is entirely configured via a pref-pane. This morning I did a quick throwaway app reading some simple settings via user defaults bindings, and changing those settings while the app runs via the command line 'defaults' app. The defaults are written, but the running app never knows that the defaults changed. It has to be relaunched to find out that values changed.
Now my intent is for a pref pane to set the defaults, and for the headless app to know when those defaults change and change its behavior accordingly. So I need some way to let the app know its defaults have changed.
So first off, is there some built-in way to simply 'goose' the app and cause its defaults bindings to trigger?
If not, what's the best practice here? And if I were to use some sort of apple event fired from the prefpane or some other technique to let the app know its defaults have changed, how do I get the user defaults controller in the headless app to apply the updates?
Thanks,
--
shamyl zakariya
- so much for pathos
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden