Re: Using NSDictionary to write to /Library/Prefererences
Re: Using NSDictionary to write to /Library/Prefererences
- Subject: Re: Using NSDictionary to write to /Library/Prefererences
- From: Chris Parker <email@hidden>
- Date: Mon, 7 Feb 2005 18:33:13 -0800
On Feb 7, 2005, at 5:18 PM, Kevin Ballard wrote:
NSUserDefaults is for user defaults, not global defaults. I think
you'd have to drop down to the Carbon calls to get equivalent
functionality using the local domain (i.e. /Library).
You should (for this case) use
CFPreferencesSetValue(key, value, appBundleID,
kCFPreferencesAnyUser, kCFPreferencesCurrentHost);
which corresponds to /Library/Preferences/appBundleID.plist
You do, of course, have to have permissions to do the write at that
location, but that should be sufficient.
NSUserDefaults will read from that just fine assuming the bundle ID is
the same. Modifications you make to your preferences using the
CFPreferences API will be reflected in calls through NSUserDefaults.
.chris
--
Chris Parker
Cocoa Frameworks
Apple, Inc.
_______________________________________________
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