• 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: Using NSDictionary to write to /Library/Prefererences
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
References: 
 >Using NSDictionary to write to /Library/Prefererences (From: John Cebasek <email@hidden>)
 >Re: Using NSDictionary to write to /Library/Prefererences (From: Evan Schoenberg <email@hidden>)
 >Re: Using NSDictionary to write to /Library/Prefererences (From: Kevin Ballard <email@hidden>)
 >Re: Using NSDictionary to write to /Library/Prefererences (From: Chris Parker <email@hidden>)

  • Prev by Date: Re: Code-insight in NSTextview
  • Next by Date: Xcode CopyFolder Phase
  • Previous by thread: Re: Using NSDictionary to write to /Library/Prefererences
  • Next by thread: NSImage rescaling
  • Index(es):
    • Date
    • Thread