替换核心数据模型,无需迁移

发布于 2025-01-01 03:20:57 字数 101 浏览 1 评论 0原文

我已经相当广泛地改变了我的核心数据模型。关于如何将旧数据迁移到新模型中存在很多问题,但是我不需要迁移任何内容。

我只想替换当前的 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

苦妄 2025-01-08 03:20:57

我假设您正在使用带有 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文