替换核心数据模型而不迁移 [英] Replace core data model without migration

查看:138
本文介绍了替换核心数据模型而不迁移的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经改变了我的核心数据模型。有很多问题如何将旧数据迁移到新模型,但我不需要迁移任何东西。

I have changed my core data model quite extensively. There are loads of question how to migrate the old data into the new model, however i don't need to migrate anything.

我只是想替换当前的核心数据实例。

I just would like to replace the current Core Data instance. How can this be done?

推荐答案

我将假设你使用持久存储协调器 NSSQLiteStoreType 。只需更改您的持久性存储协调器的URL的名称。如果以前的版本使用一个名为 MyApp.sqlite 的URL,请将其更改为 MyAppVersionX.sqlite

I'm going to assume you're using a persistant store coordinator with NSSQLiteStoreType. Just change the name of the url for your persistant store coordinator. If the previous version used a url called MyApp.sqlite, change it to MyAppVersionX.sqlite.

这篇关于替换核心数据模型而不迁移的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆