5

When I compile Core Data model, I get .mom, .omo and versioninfo file. .mom looks like Managed Object Model file. And what's .omo file? I have no idea. Especially when I want to make a static lib for iOS, it's confusing should I embed the omo file too. And Xcode doesn't recognize the data model bundle. I have to bed them as file basis. What is the .omo file?

eonil
  • 83,476
  • 81
  • 317
  • 516
  • 1
    Just a guess, but I'd assume it's got the same data organized differently. I know I can create a NSManagedObjectModel using either and get the same results out. – Bobson Sep 03 '12 at 00:53
  • Yes, and only the current version of the data model has an .omo file. When you update the current version of your data model from, say, Modelv03.mom to Modelv04.mom, Xcode will also remove the Modelv03.omo file from the .momd directory and replace it with a new Modelv04.omo file. – Jerry Krinock Mar 13 '14 at 20:14

2 Answers2

9

At WWDC this year I talked to the Core Data engineers in the labs and they told me that the .omo file is just an optimized version of the .mom file. The .mom file is a binary plist while the .omo is some other sort of format that's faster to load.

They told me that you could safely remove the .omo file and Core Data would load from the—slightly slower—.mom file instead. They told me that doing so would only result in an additional few milliseconds of load time (which begs the question of why they bothered to optimize it in the first place).

Ben Dolman
  • 3,165
  • 3
  • 25
  • 25
2

In my case, the omo file was generated when I specified RenamingID for one entity relationship. The worst thing that I link to this file was that I lost the ability to use lightweight database migration later even for simple database changes.

user908643
  • 199
  • 1
  • 5
  • This seems to be something we experienced - lightweight database migration failed, especially on iOS and this resulted in a corrupt database. How do we prevent these files from being created? – strangetimes Apr 20 '21 at 13:31