O'Reilly logo

Beginning Mac OS® X Programming by Drew McCormack, Michael Trent

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required