Sunday 15 September 2013

core data - Is it possible to generate an xcdatamodel file outside of Xcode? -


Is it possible to create an xcdatamodel file and then import that file into exode? I need to create a data model for an iOS app from an existing schema specified by an industry standard. As a result, two hundred core data entities will be with a Gazillion specialties, relationships, etc. It's just plain bigger. Being the old Unix, I prefer to write some scripts to create an XCdtodmodel file, instead of manually typing the XCodmodel file in two months via the encoded GUI, which is definitely the error Be prone. XML in Xcdatamodel file seems very straight forward. I have seen everywhere and no one can find any point in trying this, even if it does not look like a big deal for me, any comments or suggestions?

As you note, the model file is just XML, and the format for Xcode 4.0+ is read and It is easy to reverse engineer. There is no magic about creating one in Xcode, and if you can get the right of syntax, then there is no reason to exclude it without encoded.

To keep a few things in mind:

  • You probably want to generate a xcdatamodeld , which can contain multiple versions, even if You have a version yet. It will be better for long term maintenance.
  • You can verify that you have a valid model file on the command line using xcrun momc $ FILE , which is a command-line to compile Xcode Edition.
  • If you update your generated model file, Xcode can not make changes notice, so you may need to clean and build after the model update.

No comments:

Post a Comment