If you would like to share preference values among a suite of related applications, Preference Services provides a simple solution. For example, say you have a set of office productivity applications called PowerSuite. Preferences that you want to share among all of the PowerSuite applications should be saved by calling
CFPreferencesSetAppValue
, substituting the domain qualifier constant with a suite ID that you define (
com.foosoft.powersuite
, for instance). You can then use the function
CFPreferencesAddSuitePreferencesToApp
to add those preferences to each of the suite's applications when they are launched.
When a suite is added to an application's search chain, all of the domains pertaining to that suite are inserted into the search list. For example, a suite may contain preferences for both the current user and any user. Suite preferences are added between the current-application domains and the any-application domains--in other words, after domain numbers two, and/or six shown in Table 1-1. Note that if you add multiple suite preferences to the same application's search chain, the order of the suites in the chain is undefined so you should not rely on a particular ordering.
If necessary, you can override the suite preferences for a given application. Preference Services searches the current application domains before the suite preferences, so you can save a preference in both places using the same key and the application-specific preference will be used.
See the section Using Application Suite Preferences for further information about creating and retrieving suite preferences.