The interface for providing preference panes to System Preferences or other apps.
- macOS 10.1+
Preference panes are subclasses of
NSPreference, packaged up in bundles and loaded by a preference application, such as System Preferences. These bundles have a suffix of
.pref. Bundles intended for use by System Preferences are located in the
Library/Preference directories of the various file system domains. See the chapter About the macOS File System in File System Programming Guide for information about domains.
The preference pane bundle normally contains a nib file with the user interface for modifying user preferences. The nib file contains a window assigned to the _window outlet of the preference pane instance (the nib’s File’s Owner). The
NSPreference implementation of
load, invoked by the preference application, loads the nib file and uses the content view of _window as the preference pane’s main view. Override this method if you need a different technique for creating the user interface.
NSPreference subclass is responsible for initializing the user interface with the current preference settings and recording any modifications the user makes. Through a series of
should... methods, the preference application notifies the preference pane when the pane is selected (displayed) and deselected, allowing the pane to perform the necessary actions at the appropriate times. Implement these methods (and any additional target-action methods connected to the interface) as needed to produce the desired behavior for your preference pane.
Preference panes support Help menu items. Specify global help menu items in your bundle's
Info file under the
NSPref key. To add dynamic help items, implement the