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: John Cebasek <email@hidden>
- Date: Tue, 8 Feb 2005 09:36:04 -0500
Thanks very much for the info. Pointed me in the right direction!
John
On 7-Feb-05, at 9:33 PM, Chris Parker wrote:
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
_______________________________________________
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