Contents

Introduction to NSPersistentDocument Core Data Tutorial for Mac OS X v10.4

Step-by-step instructions for building a simple but functionally rich application using NSPersistentDocument and Cocoa bindings.

Who Should Read This Document

You should read this document to gain an understanding of how to create a Core Data document-based application using NSPersistentDocument and Cocoa bindings. Among other concepts, you will learn how to create the project, how to customize the creation of a document, and how to localize error messages.

Important: To complete this tutorial, you should already be familiar with basic Cocoa development practices and with Cocoa bindings. This document does not repeat fundamental Cocoa programming concepts and does not provide explicit instructions for common operations (such as using Interface Builder, including establishing bindings between user interface objects and controllers). You should, for example, ensure that you understand the material presented in <!--a target="_self" -->Cocoa Application Tutorial Using Bindings<!--/a--> .

Organization of This Document

Overview of the Tutorial describes the application you will create, and the task constraints.

Creating the Project, Model, and Interface describes how you create a Core Data document-based project in Xcode, and how you create the data model and how you can use it to automatically create a default user interface.

Creating a Custom Class describes how to implement a custom class for an entity.

Adding a Department Object describes how you add a Department object to the document, and configure the user interface appropriately.

Copy and Paste describes one way you can support copy and paste in a Core Data application.

Localizing and Customizing Model Property Names and Error Messages describes how you can localize property names and customize alert panels.

Document Metadata describes how you can add metadata to your document that Spotlight can extract—it also describes how you write the Spotlight importer.

A Sheet for Creating a New Employee describes how you can use a sheet for data entry.

See Also

Core Data Programming Guide describes functionality provided by the Core Data framework from a high-level overview to in-depth descriptions.

Core Data Utility Tutorial takes you through the steps of building a command-line utility that uses Core Data. You are strongly encouraged to complete the low-level tutorial before following this tutorial.

Note: The source code for the application described in this tutorial is available here: Departments and Employees .

Next

Copyright © 2005, 2009 Apple Inc. All Rights Reserved. Terms of Use | Privacy Policy | Updated: 2009-02-04