Parameters that work both with the command line utility and with Xcode:
--base-class : name af in the base class that inherits the "private class" (for example, _MyObject.h ). This will also add the import in the form of #import "MyManagedObject.h" to the same .h file. Tip. If the class you want to inherit is in the library, the default import statement will not work. As a workaround, you can get an additional level of inheritance for each project you create and inherit this class from the library (for example, set the base class in MyProjectManagedObject , which you create manually and inherit from MyLibManagedObject ).--template-path : path to file 4 .motemplate . When this is not provided, it will look at all the "application support directories" (for example, "/Library/Application Support/mogenerator/" ).--template-group : the name of the subdirectory under the template-path directory used.--template-var arc=true : Required for generated compilation files when using ARC.--output-dir : output directory for all generated files.--machine-dir : the directory into which the _<class>.h and _<class>.m lines will be output. If --output-dir is also specified, this option takes precedence.--human-dir : the directory into which the values โโof <class>.h and <class>.m will be displayed. If --output-dir is also specified, this option takes precedence.--includem : the full path to the file that will contain all #import for all generated .h files. This file should not exist (i.e. it will be created for you if it is not). This file will not be automatically included in the project. You must enable it manually by dragging it to the "Groups and Files" list of your project.
Using relative paths in Xcode for any of the above arguments will not work, since the working directory is installed in one of the root directories of the system (for example, applications, developer, library or system). (I did not have enough time to figure out which one is for sure.)
Parameters that cannot be used in Xcode:
--model : the path to the .xcdatamodel file cannot be set in Xcode.--list-source-files--orphaned--versioned--help
Running and sending parameters to xmod via Xcode:
(Update: I have not tried this on Xcode 4, only Xcode 3. For Xcode 4, you can add mogenerator as the build phase instead of the following steps.)
- Go to the information page of the
.xcdatamodel file. - Select the Comments tab.
- Add
xmod to the comment field in your line. - Each time you save a model, it restores the machine files for you.
To send parameters, they must be on a separate line:
It works:
xmod --base-class CLASS --template-path PATH
And even this works:
xmod --base-class CLASS --template-path PATH
But this will not work:
xmod --base-class CLASS --template-path PATH
Note. You must close the "Information" window for the settings to take effect.
Senseful Aug 28 '10 at 2:50 2010-08-28 02:50
source share