Mac OS X Developer's Guide

This chapter begins with a walk-through of the Diary application. It continues with the code that you need to use to create that application. As you will see, the application object in the Cocoa framework is critical but its default behavior is almost always satisfactory. The boilerplate code that Project Builder creates for you is generally usable without modification.
In the final part of this chapter, a brief summary of the Carbon application object in MacApp is provided. You will also find a guide to deciphering Classic and Carbon applications that have been written without the benefit of frameworks (in case you need to modify or convert such applications to Cocoa).
It is easier to understand programming concepts when portions of code are at hand. The problem is always to have examples that are complex enough to shed light on real-world problems but not so complicated as to require more explanation of the example than of the concept.
One application program is used for many of the examples in this part of the book. It is of moderate complexity, and it touches on many of the issues that most Mac OS X developers need to know about. Inside Diary, you will find the following functionality:
Windows and views, including text fields and text views, buttons, scrollers, and images
A drawer
A customizable toolbar
Documents that can be saved and reopened
Automatic dirtying of documents after changes
An undo feature
You will find wonderful examples from Apple on...