如果我们CoreData中的数据 发生了迁移或者说 版本发生了变化,我们需要在Appdelegate.m里面给其 设置 条件。 // 数据迁移
NSDictionary *options = @{
NSMigratePersistentStoresAutomaticallyOption:@YES,
NSInferMappingModelAutomaticallyOption:@YES
};然后将永久保存类型 的options设置为options
<pre name="code" class="html">1. app代理中设置条件
2. Editor-》new model version
3. 侧边栏 -》 model version 选择
4. 更新模型 (实体)