Core Data completely unable to find the source object model for migration
Core Data completely unable to find the source object model for migration
- Subject: Core Data completely unable to find the source object model for migration
- From: Matteo Manferdini <email@hidden>
- Date: Wed, 5 Aug 2009 08:20:32 +0200
Hi everybody,
I'm trying to run core data migration on the store of my app but it
seems to be unable to find the source object model no matter what. I
tried different approaches, taking some hints by some results I found
on google, but without success. This is what I tried:
- First I tried following the guide on Core Data Versioning and
Migration to do it automatically. I created a new version of the model
and set it as the current version. I created a mapping model and
called addPersistentStoreWithType:configuration:URL:options:error:
with the NSMigratePersistentStoresAutomaticallyOption option. The
method returned this error: "missing source managed object model". I
tried to point directly to the momd directory instead of using
mergedModelFromBundles:. I tried to compile the two models as top
level resources (flagging them in XCode and even moving them outside
the .xcdatamodeld directory). No way. Obviously I clean all targets
each time.
- Since the automatic migration seems not to work in any way, I
decided to do it manually, following the guide. I extract the store
metadata and check if the model is compatible. Everything works fine
(i checked it in the debugger), until I must find the suitable source
model for the store via mergedModelFromBundles:forStoreMetadata:. Same
problem as before: Core Data does not find the model and the method
returns nil. I tried to move the models in every possible way also
here, as for the first point. No way.
My last chance is to access the correct model using the direct path, a
solution that obviously sucks, because when I will need to migrate
again, my code will become a mess.
Please help, I do not know what to do.
Thank you very much.
Regards.
--
Matteo Manferdini
Pawn Software
www.pawn-soft.com
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden