Chapter 12. To Do: Basics

In Chapter 11, you learned how to create a very simple multidocument application. In this chapter you’ll use Cocoa’s multidocument architecture to create a document-based application called To Do—a fairly simple personal information manager.

This chapter guides you through the steps needed to create the basic framework of the To Do application. You’ll define the data model and create the document interface, which includes a custom calendar view. When you finish the final version of To Do in Chapter 13, the application will allow users to go to specific dates on the calendar and enter a list appointments or tasks for a particular day. In its final form, it will look like Figure 12.1.

Each To Do document captures the daily “must-do” items for a particular purpose. For instance, one could have a To Do list for work and another one for home.

The Design of To Do

The To Do application far surpasses the Travel Advisor application from Chapter 10, in terms of complexity. The To Do application has three nib files and seven custom classes. Figure 12.2 shows the interrelationships among instances of some of those classes and the nib files that they load.

The objects in this diagram should be familiar, fitting as they do into the Model-View-Controller paradigm. The ToDoItem class provides the model objects for the application; instances of this class encapsulate the data associated with the items appearing in documents. The view objects are contained in the three ...

Get Learning Cocoa now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.