替换核心数据模型,无需迁移
我已经相当广泛地改变了我的核心数据模型。关于如何将旧数据迁移到新模型中存在很多问题,但是我不需要迁移任何内容。
我只想替换当前的 Core Data 实例。这怎么能做到呢?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我假设您正在使用带有
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 calledMyApp.sqlite
, change it toMyAppVersionX.sqlite
.