Search code examples
iphoneobjective-cioscore-dataios4

Accessing a CoreData entity between app versions, etc


I inherited a project that uses CoreData for a certain type of data storage. I want to remove CoreData from the app and convert the data into a different format...

Over the course of developing other features, I had removed the CoreData framework from the app and the model declarations in such, not expecting to need to convert the old data.

But now I do need to convert the old data. So the first steps I took were to go back into source control, dig out the xcdatamodel files from the old version and plug them back into the app.

Then I went to an older version of the app, installed in on a device, created some data...

Then when I go back to the newer version of the app with CoreData "re-installed", I get a crash claiming that the data entity in question cannot be found in the managed object context. I triple checked spelling and syntax and it checks out.

I feel like maybe I'm missing some vital piece of configuration to make it recognize the xcdatamodel file that declare the entity.

Any insight would be helpful.


Solution

  • I made a syntactical flaw that was causing the full context to not be loaded properly... when I changed that then everything loaded fine.

    Sometimes these frameworks give the most misleading errors...