Core Data Migration: Extracting fields to an abstract entity child
Asked Answered
A

1

0

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.

Actinology answered 22/6, 2010 at 18:22 Comment(0)
N
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.

Normally answered 22/6, 2010 at 21:9 Comment(3)
Additionally, the log contains a lot of info specific to my app that I'd prefer to keep out of the public eye. However, I'd be happy to email it to your support email address, if that's OK with you. Thanks! :-)Actinology
I'm experiencing this problem in my project. i have a manual migration in core data that care to do a particular update to an entity. the funny think is that the migration from version 1 to 4 of the app works on iOS7, in iOS6 i get the error 134140.Winthorpe
It is possible that iOS 7 is inferring a model where iOS 6 cannot. I would suggest making sure that your heavy migration mapping model is in the right place. I would also turn on SQLite debug and watch to make sure Core Data is finding the mapping model.Normally

© 2022 - 2024 — McMap. All rights reserved.