Core Data Tutorial for iOS——Introduction

Introduction導言

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.

  • 允許在任何時刻只在內存中保存一份模型對象們的子集。這對於IOS這種節約內存很關鍵的系統尤其重要。
  • 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.

  • 用一個模型來描述模型對象。在一個基於GUI的編輯器中,你可以定義模型淚的主要特性——包括它們之間的關係。這提供了豐富的免費功能,包括默認值的設置和屬性值驗證。
  • 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

  • 使用Xcode數據建模工具的基礎
  • How to create, update, and delete objects managed by Core Data, and how to commit changes to a data store
  • 如何新建、更新和刪除由Core Data管理着的對象,以及如何提交改變到數據存儲中

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應用程序開發的基礎知識,包括:

None of these tools and techniques are explained in this tutorial, so that the content can focus on Core Data itself.爲了讓內容關注Core Data本身,本教程不會解釋說明這些工具和技術。

Documents you should read to gain adequate experience include:

你應該閱讀下列文檔,以獲得足夠的經驗:

Organization of This Document

This tutorial comprises the following chapters:本教程包括以下章節:

The source code for the tutorial is provided in the Locations sample code.

本教程的源代碼由Locations示例代碼提供。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章