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

  1. You have seen how an application's bundle structure defines various properties for an application. Use the techniques for examining bundles you learned in this chapter to answer the following questions.

    1. How many document types does the TextEdit application support?

    2. What is the Preview application's bundle signature?

    3. What is Terminal's bundle identifier?

    4. Some document types actually are bundles rather than solitary files. Examine a number of nib files. What kind of files might you find in an Interface Builder file?

    5. What is the current bundle version of the AppKit framework?

    6. What is the current bundle version of the JavaVM framework?

  2. The defaults command provides a convenient way for working with application preferences from Terminal. You can read and write preference values without having to manually find and edit the preference file. Use the defaults command to perform the following tasks; if necessary check the defaults man page for help.

    1. List all your machine-independent preference domains.

    2. List all your machine-specific preference domains.

    3. Display your Terminal preferences.

    4. Display HIToolbox's preferences.

    5. Create a new preference file called MyExamplePref with a single key Autosave set to 1.

    6. Add a key colors to your MyExamplePref preference with an array of values: red, orange, yellow.

    7. Delete the Autosave key from your MyExamplePref preference.

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