Preferences Domains

Earlier in this chapter, you read about file domains. File domains help structure the way that items are stored and protected on your computer and network. For example, you can freely access files in your Home directory (your user domain), but not files in the Home directories of other users. Preferences domains work in much the same way. They provide ways that preferences (or defaults) are stored and scoped. Preferences that apply to Microsoft Word are stored in a distinct fashion from those that apply to iMovie. Preferences that affect a single user are stored in a different manner than those that affect all users on your computer.

In Mac OS X, you may encounter two basic types of preferences domains: application-specific ( application domains) and systemwide ( global domain). Application-specific domains affect just one application at a time and include preferences specific to that application. Systemwide global domains apply to all applications. For example, as you saw in the previous chapter, Apple’s Calculator application has a “Speaks when button pressed” preference called SpeaksButtonPressedDefaultsKey. This preference belongs to the com.apple.calculator domain and affects only the current user of the Calculator application. In contrast, the AppleLocale preference, which stores the default language system (en_US for U.S. English), affects the way that every application on your computer chooses its language. The global domain is called NSGlobalDomain ...

Get Modding Mac OS X now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.