CoreData迁移和数据映射:从现有属性创建新实体(CoreData migration & data mapping: creating a new entity from existing at

编程入门 行业动态 更新时间:2024-10-22 11:35:15
CoreData迁移和数据映射:从现有属性创建新实体(CoreData migration & data mapping: creating a new entity from existing attribute)

我真的希望有人能够帮助我解决这个问题。 我试图第一次在Xcode中创建一个数据映射模型(对于iOs应用程序)。

这应该是一个非常简单的迁移(尽管轻量级迁移没有涵盖); 这是我最初拥有的以及新数据库的样子:

改变了什么:

我有一个新属性( DBdisplayOrder ),这是可选的 我有一个新的多对多关系。 我想将旧数据库的DBreminder (NSDate)属性移动到新的DBreminderDate 。 新表中的两个属性都是可选的。

所以基本上我只需要从一个属性复制数据,该属性现在位于一个新实体中。

如果有人能指出我正确的方向,或者只是推荐一个好的资源来学习和开始,我将非常感激。

I really hope someone will be able to help me out with this. I am trying to create a data mapping model (for an iOs app) in Xcode for the first time.

This should be a very simple migration (although not covered by lightweight migration); here is what I originally had and what the new database looks like:

What changed:

I have a new attribute (DBdisplayOrder), which is optional I have a new to-many relationship. I would like to move the old database's DBreminder (NSDate) attribute to the new DBreminderDate. Both attributes in the new table are optional.

So basically I only need to copy data from one attribute, which now resides in a new entity.

I would be very grateful if someone could point me in the right direction, or just recommend a good resource to study from and get started.

最满意答案

我使用这里的一个很好的描述卖掉了这个问题。

更新:( 固定链接到看似相同的博文)

这是工作映射模型:

数据库映射模型#1数据库映射模型#2

我希望它对某人有帮助。

I have sold this problem using a great description found here.

Update: (Fixed link to what appears to be the same blog post)

Here is the working mapping model:

DB mapping model #1 DB mapping model #2

I hope it helps someone.

更多推荐

本文发布于:2023-08-04 14:09:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1416077.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:实体   属性   数据   migration   CoreData

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!