Core Data is a schema-driven object graph management and persistence framework. Fundamentally, Core Data helps you to save model objects (in the sense of the model-view-controller design pattern) to a file and get them back again. This is similar to archiving (see Archives and Serializations Programming Guide), but Core Data offers much more than that. Amongst other things, it:
Core Data是一个模型驱动的对象关系图管理和持久存储框架。从根本上说,Core Data有助于你将模型对象(模型 - 视图 - 控制器设计模式意义上的)保存到一个文件中,以及将他们取回来。这类似于归档(参看归档和序列化编程指南),但Core Data提供的更多。除此以外,它还提供:
Provides an infrastructure for managing all the changes to your model objects. This gives you automatic support for undo and redo, and for maintaining reciprocal relationships between objects.
提供一个基础架构,用于管理你的模型对象的所有更改。这使您的app自动支持撤消和重做,并能维护对象之间的相互关系。
Allows you to keep just a subset of your model objects in memory at any given time. This is especially important on iOS where conserving memory is critical.
Uses a schema to describe the model objects. You define the principal features of your model classes—including the relationships between them—in a GUI-based editor. This provides a wealth of basic functionality “for free,” including setting of default values and attribute value validation.
Allows you to maintain disjoint sets of edits of your objects. This is useful if you want to, for example, allow the user to make edits in one view that may be discarded without affecting data displayed in another view.
Has an infrastructure for data store versioning and migration. This lets you easily upgrade an old version of the user’s file to the current version.
Core Data is available on iOS 3.0 and later.
Core Data只在ios3.0及之后的版本中提供。
You should read this document to learn how to use Core Data on iOS, including:
在IOS中,你应该阅读本文档来学习如何使用Core Data。包括:
The fundamental design patterns and techniques that underlie Core Data
基本的设计模式和技术,这些是 Core Data的基础
The basics of using the Xcode data modeling tool
Important: Core Data is not an entry-level technology. Before starting to use Core Data, you must understand the basics of iOS application development, including:
重要提示:Core Data不是一个入门级的技术。在开始使用Core Data之前,你必须了解iOS应用程序开发的基础知识,包括:
How to use Xcode and Interface Builder
如何使用Xcode和Interface Builder
Fundamental design patterns such as model-view-controller and delegation
How to use view controllers, navigation controllers, and table views
如何使用视图控制器,导航控制器和表视图
Documents you should read to gain adequate experience include:
你应该阅读下列文档,以获得足够的经验:
This tutorial comprises the following chapters:本教程包括以下章节:
The source code for the tutorial is provided in the Locations sample code.
本教程的源代码由Locations示例代码提供。