Convert Core Data file from binary to XML

core-data, xcode

Solution

You can convert the old binary files to XML by changing the Tools Version on the .xcdatamodel file in Xcode.

Steps:

- Select the .xcdatamodel file in Xcode.

- In the Utilities pane (⌘⌥0 - the pane on the right side), find Core Data Model > Tools Version and set the Minimum to Xcode 4.1 (or greater).

- Voila! Your .xcdatamodel file should now be formatted as XML.

Thanks to Sam Hatchett's answer for pointing me to this answer which ultimately led to the solution.

Problem

Xcode 4 apparently now stores Core Data files in XML, whereas prior versions created binary files. I'd like to convert some older .xcdatamodel files (well, the elements and layout binary files in that package) to XML versions so that I can diff and merge them across multiple source control branches. Does anyone know how to take an existing Xcode Core Data model file (.xcdatamodeld, .xcdatamodel, or whatever) and convert it to the newer XML file?

Original source

Related problems