核心数据中NSINMEMORYSTORETYPE不需要模型版本吗?

发布于 2025-01-31 12:35:17 字数 145 浏览 1 评论 0原文

是否有任何充分的理由来版本模型,这些模型专门用于nsinmemorystreetype商店?没有持久性,除了文档目的外,版本控制似乎是不必要的。由于迁移是在数据模型范围之外处理的,因此很明显为什么该选项可用,但是我在这里可能会忽略一些核心数据吗?

Are there any good reasons to version models that are exclusively used for NSInMemoryStoreType stores? Without persistence, versioning seems unnecessary except for maybe documentation purposes. As migrations are handled outside of the scope of the data model, it's obvious why the option is available, but is there some quirk of Core Data that I might be overlooking here?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

恰似旧人归 2025-02-07 12:35:17

如果您仅使用内存商店,则没有理由打扰模型迁移。核心数据使用模型迁移来更新持久存储以使用新的数据模型。使用内存中的商店并不是真正持久的商店,因为该应用程序每次运行时都会创建一个新的商店,因此没有现有数据可以迁移。

If you only use in-memory stores, there's no reason to bother with model migration. Core Data uses model migration to update a persistent store to use a new data model. With an in-memory store the store isn't really persistent, since the app creates a new one every time it runs, so there's no existing data to migrate.

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