核心数据迁移:将字段提取到抽象实体子代 [英] Core Data Migration: Extracting fields to an abstract entity child

查看:449
本文介绍了核心数据迁移:将字段提取到抽象实体子代的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个迁移,其中我将字段从一个实体移动到另一个实体,这是一个抽象实体的孩子。我的模型有一个实体 Thing ,它是一个抽象实体的1-> M, AbstractWidget parent for NewStuff 。像这样:

  + ------- + + ------------ ---- + + ---------- + 
| Thing |< --->> | AbstractWidget |< --- | NewStuff |
+ ------- + + ---------------- + + ---------- +

我把 Thing 的几个属性移动到 NewStuff ,我一直按照我发现一个博客文章,有相似的更改的说明



我已经创建了一个具有结构变化的新版本,并创建了一个映射模型,它包含一个名为ThingToNewThing的映射,映射这些字段,但不映射关系,按照说明。我没有使关系改变,因为AbstractWidgets已经设置正确工作。



当我运行我的应用程序,我得到一个完整的流发送到控制台,启动如下:

  2010-06-22 14:14:07.463 MyAppName [31418:207]未解决的错误错误域= NSCocoaErrorDomain代码= 134140 UserInfo = 0x55249d0操作无法完成。(可可错误134140.)

...之后是似乎是现有数据属性的列表。



我在任何地方找不到任何关于Cocoa错误134140的内容,

解决方案

任何指导都会非常感激。 / div>

首先,将 [error userInfo] 也输出到控制台,这将告诉你究竟是什么问题。



其次,将输出复制并覆盖到您的问题中,以便我可以看看:)



更新



根据您寄给我的日志文件,这里是基本问题:


无法找到或自动推断用于迁移的映射模型


这意味着无法找到映射模型。因此,它无法匹配源模型或无法匹配目标模型,或者您的映射模型未包含在捆绑包中。


I have a migration where I'm moving fields from one entity into another entity which is a child of an abstract entity. My model has an entity, Thing, which is 1->M to an abstract entity, AbstractWidget, which is the parent for NewStuff. Something like this:

+-------+      +----------------+    +----------+
| Thing |<--->>| AbstractWidget |<---| NewStuff |
+-------+      +----------------+    +----------+

I am moving several attributes from Thing to NewStuff, and I've been following the instructions on a blog post I found that has instructions for making a similar change.

I've created a new version with the structural changes, and created a mapping model that include a mapping called ThingToNewThing, which maps the fields, but does not map the relationship, per the instructions. I didn't make the relationship change, as the AbstractWidgets is already set up to properly work.

When I run my app, I get a whole stream of stuff sent to the console, that starts like this:

2010-06-22 14:14:07.463 MyAppName[31418:207] Unresolved error Error Domain=NSCocoaErrorDomain Code=134140 UserInfo=0x55249d0 "Operation could not be completed. (Cocoa error 134140.)"

... followed by what seems to be a listing of the existing data properties.

I can't find anything about Cocoa error 134140 anywhere, and I'm not sure where to go from here.

Any guidance would be greatly appreciated.

解决方案

First, start by spitting out the [error userInfo] to the console as well, that will tell you exactly what is the issue.

Second, copy and past that output into your question so that I can take a look :)

Update

Based on the log file you sent to me, here is the underlying issue:

Can't find or automatically infer mapping model for migration

This means it is failing to find the mapping model. So either it cannot match up the source model or cannot match up the destination model or your mapping model is not included in the bundle.

这篇关于核心数据迁移:将字段提取到抽象实体子代的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆