• 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
Using NSUserDefaults for Other Apps' Preferences
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Using NSUserDefaults for Other Apps' Preferences


  • Subject: Using NSUserDefaults for Other Apps' Preferences
  • From: Jerry Krinock <email@hidden>
  • Date: Tue, 26 Sep 2006 14:48:07 -0700
  • Thread-topic: Using NSUserDefaults for Other Apps' Preferences

For the first 6 months I was writing Cocoa apps, I used the Carbon
CFPreferences functions because no one told me that "user defaults" was the
new word for "preferences".

Today, I discovered that "Persistent domain" means "preferences" too.  Using

­ persistentDomainNames
­ persistentDomainForName:
­ removePersistentDomainForName:
­ setPersistentDomain:forName:

you can:

* get the com.company.app "domain names" for all other apps, also
    called the "bundle identifier"
* read and write preferences for any app
* read all the prefs for any app, including yours

There is no other way to do the latter, and it is handy for including in
users' trouble reports.

The only thing that bothers me is that the documentations for these methods
states that the "value [of the argument Name:] should be equal to your
application's bundle identifier."  However, it seems to work fine if I use a
another app's bundle identifier; it affects preferences for the other app.
Has anyone ever run into a problem with this?

Jerry Krinock


 _______________________________________________
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 NSUserDefaults for Other Apps' Preferences
      • From: Jerry Krinock <email@hidden>
  • Prev by Date: Re: NSUersDefaults and setting for a specific domain
  • Next by Date: Re: Using NSUserDefaults for Other Apps' Preferences
  • Previous by thread: MOC NSDeletedObjectsKey notifications on undo/redo show default object values?
  • Next by thread: Re: Using NSUserDefaults for Other Apps' Preferences
  • Index(es):
    • Date
    • Thread