Introduction to Core Data Utility Tutorial
A hands-on guide to creating a command-line utility using low-level features of Core Data.
Who Should Read This Document
You will find this tutorial useful if you are using the Core Data framework to create a utility that does not have a user interface or if you want to gain a deeper understanding of the Core Data infrastructure.
Important: This tutorial is not intended for novice Cocoa developers. You must already be familiar with basic Cocoa development tools and techniques. This document does not repeat fundamental Cocoa programming concepts, nor does it provide explicit instructions for common operations in Xcode.
You should already be familiar with the fundamental Core Data architecture as described in <!--a target="_self" -->Core Data Basics<!--/a--> in Core Data Programming Guide . This tutorial is intended to reinforce the ideas explained in that article.
If you are developing applications for iOS, you may find it useful to work through <!--a target="_self" -->Core Data Tutorial for iOS<!--/a--> before attempting this tutorial. <!--a target="_self" -->Core Data Tutorial for iOS<!--/a--> describes the architecture of the Core Data stack created by the Xcode templates.
Organization of This Document
Creating the Project describes how you create a Foundation Tool project in Xcode, and how you link in Core Data.
Creating the Managed Object Model describes how you create the data model for the utility in code.
The Application Log Directory illustrates one way to identify and if necessary create a directory in which to save the file for the utility’s persistent store.
Creating the Core Data Stack describes how to create and configure the managed object context and the persistent store coordinator in code.
The Custom Managed Object Class specifies the Run entity and describes how to implement a custom managed object class.
Listing Previous Runs describes how to fetch Run instances from the persistent store.
Complete Source Listings shows the complete source code for the project.
See Also
Core Data Programming Guide describes functionality provided by the Core Data framework from a high-level overview to in-depth descriptions.
Next
Copyright © 2005, 2013 Apple Inc. All Rights Reserved. Terms of Use | Privacy Policy | Updated: 2013-09-18