• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSUserDefaults writing to machine wide preferences?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: NSUserDefaults writing to machine wide preferences?
      • From: Jim Correia <email@hidden>
References: 
 >NSUserDefaults writing to machine wide preferences? (From: Jim Correia <email@hidden>)

  • Prev by Date: Can font's be packaged in an app bundle?
  • Next by Date: Re: NSUserDefaults writing to machine wide preferences?
  • Previous by thread: NSUserDefaults writing to machine wide preferences?
  • Next by thread: Re: NSUserDefaults writing to machine wide preferences?
  • Index(es):
    • Date
    • Thread