Returns a preference value for a given domain.


CFPropertyListRef CFPreferencesCopyValue(CFStringRef key, CFStringRef applicationID, CFStringRef userName, CFStringRef hostName);



Preferences key for the value to obtain.


The ID of the application whose preferences are searched. Takes the form of a Java package name, such as com.foosoft.


kCFPreferencesCurrentUser if to search the current-user domain, otherwise kCFPreferencesAnyUser to search the any-user domain.


kCFPreferencesCurrentHost if to search the current-host domain, otherwise kCFPreferencesAnyHost to search the any-host domain.

Return Value

The preference data for the specified domain. If the no value was located, returns NULL. Ownership follows the The Create Rule.


This function is the primitive get mechanism for the higher level preference function CFPreferencesCopyAppValue Unlike the high-level function, CFPreferencesCopyValue searches only the exact domain specified. Do not use this function directly unless you have a need. All arguments must be non-NULL. Do not use arbitrary user and host names, instead pass the pre-defined domain qualifier constants.

Note that values returned from this function are immutable, even if you have recently set the value using a mutable object.

See Also

Getting Preference Values


Obtains a preference value for the specified key and application.


Constructs and returns the list of all keys set in the specified domain.


Returns a dictionary containing preference values for multiple keys.


Convenience function that directly obtains a Boolean preference value for the specified key.


Convenience function that directly obtains an integer preference value for the specified key.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software