• 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: Chris Parker <email@hidden>
  • Date: Mon, 7 Feb 2005 18:33:13 -0800


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
  • Follow-Ups:
    • Re: Using NSDictionary to write to /Library/Prefererences
      • From: John Cebasek <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>)

  • Prev by Date: Re: UDP sockets and Cocoa abstractions
  • Next by Date: Re: subclassed NSOpenGLView won't draw in subclassed NSView
  • Previous by thread: Re: Using NSDictionary to write to /Library/Prefererences
  • Next by thread: Re: Using NSDictionary to write to /Library/Prefererences
  • Index(es):
    • Date
    • Thread