核心数据中NSINMEMORYSTORETYPE不需要模型版本吗?
是否有任何充分的理由来版本模型,这些模型专门用于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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您仅使用内存商店,则没有理由打扰模型迁移。核心数据使用模型迁移来更新持久存储以使用新的数据模型。使用内存中的商店并不是真正持久的商店,因为该应用程序每次运行时都会创建一个新的商店,因此没有现有数据可以迁移。
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.