Is there any way to reverse engineer a Core Data 'mom' file (compiled core data model)?
Yes it can be done with momdec.
Here is a link to my fork that adds support for to-many relations:
Build the project and then copy the command line app from Products to your bin folder.
Here is an example of how to reverse engeinner the Notes app model which is a very interesting one, in particular its use of entity inheritance:
cd "/Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot"
momdec System/Library/PrivateFrameworks/NotesShared.framework/NoteData.mom ~/Desktop/
There is a way to do this easily.
You can import a compiled datamodel file (.mom) into a model design document (.xcdatamodel) using Xcode > Design > Data Model > Import. This will effectively allow you to 'reverse engineer', if you wish, the compiled mom file and inspect it's model.
Edit:
In the Xcode 5 and later, the menu is under Editor->Import. But this menu will only appear when you click the .xcdatamodel
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With