Adds, modifies, or removes a preference.
- iOS 2.0+
- macOS 10.0+
- Mac Catalyst 13.0+
- tvOS 9.0+
- watchOS 2.0+
- Core Foundation
The preference key whose value you wish to set.
The value to set for the specified
keyand application. Pass
NULLto remove the specified key from the application’s preferences.
New preference values are stored in the standard application preference location,
~/Library/Preferences/. When called with
k, modifications are performed in the preference domain “Current User, Current Application, Any Host.” If you need to create preferences in some other domain, use the low-level function
You must call the
CFPreferences function in order for your changes to be saved to permanent storage.