core data 学习笔记

学习路线: 
Core Data Tutorial for iOS
code: CoreDataBooks


Xcode Tools for Core Data
Xcode Mapping Tool for Core Data

Cocoa Bindings Programming Topics



???: 实现SELECT 部分字段效果用:
  NSExpression 的  expressionForKeyPath:
  NSExpressionDescription ?
[fetchRequest setPropertiesToFetch:[NSArray arrayWithObject:expressionDescription]];



context -‐-‐-‐> coordinator -‐-‐-‐> model


1. Managed Object Model  is an object representation of a schema that describes your database
is a collection of entity description objects (instances of  NSEntityDescription).


2. A persistent object store  represents an external store (file) of persisted data

When you fetch records, Core Data retrieves results from all of them (unless you specify which store you’re interested in).

3. A managed object  is  an object representation of a record in a table in a database
A managed object is associated with an entity description (an instance of  NSEntityDescription)  that provides metadata about the object (including the name of the entity that the object represents and the names of its attributes and relationships)

4. The managed object context   manage a collection of managed objects. These objects form a group of related model objects that represent an internally consistent view of one or more persistent stores.

5. 一个Entity 可以 用于存放不同的store..
You specify the store for an object using the  NSManagedObjectContext  method,  assignObject:toPersistentStore:.








Transient properties   are properties that you define as part of the model, but which are not saved to the persistent store as part of an entity instance's data.

an attribute is optional—that is, it is not required to have a value

Fetched properties represent weak, one‐way relationships
可以  cross stores.

Relationships  represent to-many relationship
不能  cross stores.

Faulting :  a managed object may be a “fault”—an object whose property values have not yet been loaded from the external store

When you fetch a managed object, Core Data does not automatically fetch data for other objects to which it has relationships

转载于:https://my.oschina.net/dake/blog/196759

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值