Core Data是如何工作的
来源:互联网 发布:c语言 flag 编辑:程序博客网 时间:2024/05/18 03:25
How Core Data Works
Although you have written no code, many objects will be created to make this work. Figure 11.14 is a diagram of some of them.
Figure 11.14. Overview of Core Data
So, the NSPersistentDocument reads in the model you created and uses it to create an instance ofNSManagedObjectModel. In our case, the managed object model has one NSEntityDescription, which describes our Car entity. That entity description has several instances of NSAttributeDescription.
Once it has the model, the persistent document creates an instance of NSPersistentStoreCoordinator and an instance of NSManagedObjectContext. The NSManagedObjectContext fetches instances ofNSManagedObject from the object store. While those managed objects are in memory, the managed object context observes them. Whenever the data inside the managed objects is changed, the managed object context registers the undo action with the document's NSUndoManager. The managed object context also knows which objects have been changed and need to be saved.
So, among the classes in the Core Data framework, you will find yourself interacting withNSManagedObjectContext the most. To fetch objects, you will use NSManagedObjectContext. To save changes to your object graph, you will use NSManagedObjectContext.
- Core Data是如何工作的
- oracle是如何工作的
- Oracle是如何工作的
- Oracle是如何工作的
- Oracle是如何工作的
- Oracle是如何工作的
- SSL是如何工作的?
- 杀毒软件是如何工作的
- SSL是如何工作的?
- Flex是如何工作的
- Oracle是如何工作的
- HttpModule是如何工作的
- SSL是如何工作的
- HttpModule是如何工作的
- make是如何工作的
- cocoon2是如何工作的?
- 搜索引擎是如何工作的?
- Oracle是如何工作的
- 实习笔记--------------Linux下解压命令大全
- oracle9ias containers for j2ee(oc4j)
- common-configuration读取xml,properties文件(二)
- gcc: Compilation Warning: incompatible implicit declaration of built-in function `bzero’
- 递归算法在Java中的应用(Java遍历文件夹)
- Core Data是如何工作的
- Ruby 学习笔记(一)
- HTTP 状态代码
- oo(面向对象)三要素精炼总结
- Servlet和Struts2的交互
- 15 个 HTML5 Canvas 应用欣赏
- LCS -- 最长公共子序列
- 忘掉蜗居努力10000小时
- 加密解密字符串