On 12/03/2008, at 10:16 AM, Karl Moskowski wrote:
Why not do it the other way round? Update settings via distributed objects, and have the daemon write them to /Library/Preferences.Good idea. Thanks, Hamish.
I'm not so sure it's a good idea. The problem is that it relies on your daemon running which whilst might be true most of the time, it might not be—if it's restarting for example. I personally would write the defaults from the GUI application.
Do processes run by launchd automatically write their preference plists to /Library/Preferences/ using NSUserDefaults?
No I don't think they will. If you're running as root, preferences will get written to /var/root/Library/Preferences which is not what you want.
To write to /Library/Preferences I think you'll need to use CFPreferencesSetValue.
If you can get away with it you could just periodically check to see if the defaults have changed. A Cocoa application will periodically synchronise the defaults but you'll still have to check to see if anything has changed. If that doesn't work for you, you can use distributed objects as you've suggested or you can use any of the other IPC mechanisms available to you.
- Chris
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]