//基本概念(用关系数据库的概念来解释):model相当于数据库,entity相当于表,attribute 相当于表中的字段, relationship相当于关系
@implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
// 1、初始化模型(数据库)
NSManagedObjectModel * model = [NSManagedObjectModel mergedModelFromBundles:nil];
// 2、创建基础库协调器
NSPersistentStoreCoordinator * psc = [[NSPersistentStoreCoordinator alloc] initWithManagedObjectModel:model];