Cocoa Programming for OS X: The Big Nerd Ranch Guide
by Aaron Hillegass, Adam Preble, Nate Chandler
The Document Architecture
Applications that deal with multiple documents have a lot in common. Every such application can create new documents, open existing documents, save or print open documents, and remind the user to save edited documents when they try to close a window or quit the application. AppKit supplies three classes that take care of most of the details for you: NSDocumentController, NSDocument, and NSWindowController. Together, these three classes constitute the document architecture.
The purpose of the document architecture relates to the Model-View-Controller design pattern discussed in Chapter 1. In RaiseMan, your subclass of NSDocument acts as the window controller. It will have a reference to the model objects, ...