Re: NSUserDefaults writing to machine wide preferences?
Re: NSUserDefaults writing to machine wide preferences?
- Subject: Re: NSUserDefaults writing to machine wide preferences?
- From: Chris Parker <email@hidden>
- Date: Thu, 30 Jan 2003 14:25:50 -0800
Hi Jim,
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.
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 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.
.chris
--
Chris Parker
Cocoa Frameworks Engineer
Apple Computer, Inc.
_______________________________________________
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.