Who Should Read This Document
Organization of This Document
This document describes the essential components of a Cocoa application and how they work together. It also discusses features of Cocoa applications and the principles related to their design.
Every developer who creates Cocoa applications should read this document.
To understand the information in this document you should have a general knowledge of Cocoa programming paradigms, which are described in the Cocoa Fundamentals Guide.
Three important features of the Cocoa frameworks—the document architecture, scripting, and undo and redo—have a great deal in common conceptually. This document explains their shared conceptual underpinnings. It does not go into great detail about the specifics of the classes implementing these features or how to use them. Instead it concentrates on the recommended structure of an application and how that structure supports these features.
The Cocoa frameworks are AppKit.framework
and Foundation.framework
. You can examine them in /System/Library/Frameworks/
.
This document contains the following articles:
“Features of a Cocoa Application” describes the features provided by the Application Kit that are shared by all Cocoa applications.
“Document Architecture” explains how the Application Kit supports document-based applications. This common type of application enables users to create and edit documents: container objects that manage user data and present it in windows.
“Scripting” explains the concepts you need to understand to make your application scriptable—that is, one that responds to Apple events using the AppleScript system.
“Undo and Redo” describes the support Cocoa provides for implementing undo and redo, and explains how those features work with the document architecture and other application mechanisms.
“Graceful Application Termination” explains how a Cocoa application can quit executing gracefully—that is, ensuring that the user's data is saved and cleaning up after itself.
This document uses Objective-C to describe specific APIs. However, all scripting, document, and undo APIs published in Mac OS X versions through version 10.4 are also available in Java. Special issues related to Java are discussed where appropriate, and if Java isn’t mentioned specifically, it is because there is nothing special to say about it.
© 2001, 2006 Apple Computer, Inc. All Rights Reserved. (Last updated: 2006-08-07)