Incompatible Object Model Version

Can anyone explain what is going on here? I have a file that I just saved from a new version of my application, but if I close my application and double-click this document file, it will give me this error:

The document "main" could not be opened. The managed object model version used to open the persistent store is incompatible with the one that was used to create the persistent store. 

Now I checked Google for this, and it seems to be quite common, however I tried to report the deletion of files in the application support folder (for some reason it does not exist) and cleared all the targets from Xcode (Build> Clean All Targets) without good luck. The weirdest part is when I accept this error and look at the downloaded application, this is the old version. Where can I find this mysterious version of my application and how to fix it ?!

+4
source share
2 answers

Just for those who have problems with this - I also had problems installing the application correctly (when testing for presentation in the App Store), and when viewing the installerโ€™s logs it showed my application in some WEIRD places on the computer. Uninstall them and reinstall (or not just debug them with Xcode) and fix the problem.

0
source

I circumvented this issue by suppressing the CoreData version check:

  NSDictionary *options = @{NSIgnorePersistentStoreVersioningOption:@NO} NSPersistentStoreCoordinator *coordinator = [[NSPersistentStoreCoordinator alloc] initWithManagedObjectModel:mom]; if (![coordinator addPersistentStoreWithType:NSSQLiteStoreType configuration:nil URL:url options:options error:&error]) { [[NSApplication sharedApplication] presentError:error]; return nil; } 
0
source

Source: https://habr.com/ru/post/1336914/


All Articles