Who Should Read This Document
Organization of This Document
This document describes how to use the architecture supplied by the Application Kit to create applications that can create, open, load, and save multiple document files.
Every developer who wants to use the document architecture of the Application Kit should read this document.
To understand the information in this document you should have a general knowledge of Cocoa programming paradigms and, to understand the code examples, familiarity with the Objective-C language.
By using the document architecture provided by the Application Kit, you acquire many features of a well-crafted application “for free,” but you must understand the architecture to implement it properly.
Some of the articles in this document describe window management using the NSWindowController
class. However, window management with NSWindowController
objects is a technique that is not limited to document-based applications. You can also use NSWindowController
without an associated NSWindow
object.
This document contains the following articles:
“Document-Based Application Architecture” provides an overview of the classes that make up a document-based application and defines a document in the context of the Application Kit framework.
“The Roles of Key Objects in Document-Based Applications” describes how the three major classes in the document-based application architecture play distinct but cooperating roles.
“Implementing a Document-Based Application” describes the tasks you must do, and those you might want to do, when implementing a document-based application.
“Creating a Subclass of NSDocument” describes how to subclass NSDocument
.
“Creating a Subclass of NSDocumentController” describes how to subclass NSDocumentController
.
“Message Flow in the Document Architecture” describes the default message flow among major objects of the document architecture.
“Window Closing Behavior” describes how the document architecture automates memory management for documents and their associated windows and window controllers.
“Window Controllers and Nib Files” describes the management of a nib file.
“Storing Document Types Information in the Application's Property List” describes how document-based applications use a property list to specify the document types the application can edit or view.
“Saving HFS Type and Creator Codes” describes how to save hierarchical file system type and creator codes in documents.
“Creating Multiple-Document-Type Applications” explains how to use multiple types of documents based on different NSDocument
subclasses in a document-based application.
“Autosaving in the Document Architecture” describes the autosave feature built into the document architecture and explains how to turn it on in your application.
“Error Handling in the Document Architecture” explains how to take advantage of the Application Kit's robust error handling and provides some best practices advice for overriding methods that take NSError
parameters.
“Frequently Asked Questions” answers common questions about the document-handling classes in the Application Kit.
© 2001, 2009 Apple Inc. All Rights Reserved. (Last updated: 2009-01-12)