Re: NSUserDefaults writing to machine wide preferences?
Re: NSUserDefaults writing to machine wide preferences?
- Subject: Re: NSUserDefaults writing to machine wide preferences?
- From: Jim Correia <email@hidden>
- Date: Thu, 30 Jan 2003 17:29:06 -0500
On Thursday, January 30, 2003, at 05:25 PM, Chris Parker wrote:
On Thursday, January 30, 2003, at 11:57 AM, Jim Correia wrote:
I notice that if I put a preference in
/Library/my.bundle.identifier.plist by hand, that it is picked up in
the default search path for NSUserDefaults.
I'm hoping that's /Library/Preferences/my.bundle.identifier.plist - if
it's picking it up in /Library that's a bug, I think.
Yes - I dropped the path component.
Is there a way to use NSUserDefaults to put something there, or do I
just need to make the CF call?
CFPreferencesSetValue(CFSTR("Key"), CFSTR("Value"),
kCFPreferencesCurrentApplication, kCFPreferencesAnyUser,
kCFPreferencesCurrentHost);
Yes, but this will fail unless the user has permission to write into
/Library/Preferences (the average user doesn't). You'll have to use
the Authorization Services to be able to write this preference to > disk.
I understand. I wanted the give the admin the ability to set a machine
wide fallback preference in case the user hadn't set one yet.
(I guess the same question applies to per host prefs...)
NSUserDefaults doesn't have the ability to write per-host preferences
at the moment, so using the CFPreferencesSetValue API is the correct
way to do this.
Does it not have that capability as a design decision, or lack of
current implementation? (In other words, should I file an enhancement
request.)
Jim
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.