xcodepluginscore-datainstallationmogenerator

How do I use Mogenerator?


I installed Mogenerator. Now what do I do? How do I use it?

The first problem I have is that I have no idea where it was installed to. During the install process, it only let me select the hard drive to install it on, not the directory. The most natural location would be the Applications folder, but it isn't there.

Next, the readme (which I found online) states:

Xmo'd works by noticing when your *.xcdatamodel is saved. If the model file's Xcode project item comment contains xmod, an AppleScript is fired that creates a folder based on your model's file name and populates it with derived source code files from your model. It then adds the new folder to your project as a Group Reference and adds all the source files to your project.

There are several issues with the above statement that aren't clear:


Solution

  • mogenerator is a script that is installed into your developer directory as I recall. However it might be installed into the Xcode scripts directory under your ~/Library.

    What do you mean by manually triggering the application? You can trigger a build by "touching" the data model. Any save on the data model will trigger the build

    In Xcode if you select the model file and hit ⌘I you will get its metadata. Click on the comments tab and add xmod there. mogenerator looks for that comment to know if it should generate files.

    Update

    You can run mogenerator from the command line as well as have it monitor your files. Type mogenerator --help in the Terminal to see the options.