Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't find mapping model for migration, where does the mapping model have to go?

I have a project that uses CoreData on iOS and we have gone through numerous model updates with the lightweight migration technique and the NSInferMappingModelAutomaticallyOption set to YES. This works perfectly fine, but for the current transition we need to specify some more information and thus create a mapping model.

I created the mapper by going to File->New and create a new data model mapper that maps the old version of my model to the new version. The mapper is in the Resources folder in the project. Before doing any customization I wanted to check whether the model works and removed the NSInferMappingModelAutomaticallyOption from the options Dictionary when creating the persistentStoreCoordinator. However, now I get an error that says "Can't find mapping model for migration" even though I can see that the compiled mapper is bundled with the app.

Where do I have to put the data model mapper such as that it is found automatically? I use XCode 4.0

like image 980
Robin Avatar asked Jan 29 '26 13:01

Robin


1 Answers

Turns out the answer is very simple: Upgrade from XCode 4.0 to (at least) XCode 4.0.2 and it works like a charm. Must be a bug in the XCode version.

like image 65
Robin Avatar answered Feb 01 '26 09:02

Robin



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!