CoreData使用须知

来源:互联网 发布:js调用图片保存的方法 编辑:程序博客网 时间:2024/05/16 02:02

1.首先需要创建core data 的上下文环境NSManagedObjectContext;

2.NSManagedObjectContext 需要 setPersistentStoreCoordinator:(NSPersistentStoreCoordinator*)

3.NSPersistentStoreCoordinator,需要包含数据存储的位置,以及数据中包含的NSManagedObjectModel;如文档中描述Instances ofNSPersistentStoreCoordinator associate persistent stores (by type) with a model (or more accurately, a configuration of a model) and serve to mediate between the persistent store or stores and the managed object context or contexts.

原创粉丝点击