5.4. Application Preferences

Most programs provide a preferences panel that allows users to customize the application to fit their needs. By convention, applications are supposed to store their preferences in a specific place with a specific file format. The system also provides tools that encourage developers to enforce these conventions.

Try It Out: Examining Preference Files

  1. Launch /Applications/TextEdit. TextEdit displays a new, untitled text document.

  2. Choose TextEditPreferences. A Preferences window appears, as shown in Figure 5-15.

  3. Click the Restore All Defaults button. This returns TextEdit's preferences to what they were when Mac OS X was first installed. If you have already customized TextEdit's preferences, you might write down your settings so that you can restore them later.

  4. Close the Preferences window.

  5. Enter some text in the text document. Anything will do; you just need enough text for TextEdit to note that the document needs to be saved.

  6. Save the document to the Desktop. Name it Document.

  7. Quit TextEdit.

    Figure 5.15. Figure 5-15
  8. In Finder go to the Library/Preferences directory in your home directory. You will see a number of files and folders. The majority of files are property lists, or .plist files.

  9. Open the com.apple.TextEdit.plist file. The file should open in a program ...

Get Beginning Mac OS® X Programming 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.