Is it possible to generate an xcdatamodel file and then import that file into Xcode? I need to create a data model for an iOS app from an existing schema specified by an industry standard. The result will be around two hundred Core Data entities with a gazillion attributes, relationships, etc, etc. It's just plain big. Being an old Unix guy, I would prefer to write some scripts to generate the xcdatamodel file rather than spend two months entering it manually via the Xcode GUI which would, of course, be error prone. The XML in the xcdatamodel file seems very straight forward. I've looked everywhere and can find no reference of anybody trying this even though it doesn't seem like that big of deal to me. Any comments or suggestions?
As you note, the model file is just XML, and for Xcode 4.0+ the format is easy to read and reverse engineer. There's nothing magic about creating one in Xcode, and no reason not to do it outside of Xcode if you can get the syntax right.
A couple of things to keep in mind:
xcdatamodeld
that can contain multiple versions, even if you only have one version so far. It'll be better for long term maintenance.xcrun momc $FILE
, which is the command-line version of having Xcode compile it.