Core Data Migration: Extracting fields to an abstract entity child

帅比萌擦擦* 提交于 2019-12-25 03:27:02

问题


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.


回答1:


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.



来源:https://stackoverflow.com/questions/3095950/core-data-migration-extracting-fields-to-an-abstract-entity-child

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!