Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1032437
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T14:04:37+00:00 2026-05-16T14:04:37+00:00

The help for Mogenerator is very minimal. What do all the parameters do?

  • 0

The help for Mogenerator is very minimal. What do all the parameters do?

  • 1 1 Answer
  • 3 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T14:04:37+00:00Added an answer on May 16, 2026 at 2:04 pm

    Parameters that work both via the command line utility and Xcode:

    • --base-class: The name af the base class which the "private class" (e.g. _MyObject.h) will inherit from. This will also add an import in the form of #import "MyManagedObject.h" to the same .h file. Tip: if the class you want to inherit from is located in a library, the default import statement won’t work. As a workaround, you could have an extra level of inheritance for each project you create and have that class inherit from the library on (e.g. set the base class to MyProjectManagedObject which you create manually and inherit from MyLibManagedObject).
    • --template-path: The path to where the 4 .motemplate files are located. When this is not provided, it will look at all the "app support directories" (e.g. "/Library/Application Support/mogenerator/").
    • --template-group: A subdirectory name underneath the template-path directory to use.
    • --template-var arc=true: Required for the generated files to compile while using ARC.
    • --output-dir: The output directory for all generated files.
    • --machine-dir: The directory where the _<class>.h and _<class>.m will be output to. If –output-dir is also defined, this parameter takes precedence.
    • --human-dir: The directory where the <class>.h and <class>.m will be output to. If –output-dir is also defined, this parameter takes precedence.
    • --includem: the full path to a file that will include all the #import for all the .h files that are created. This file does not need to exist (i.e. it will be created for you if it doesn’t). This file, will not be included in the project automatically for you. You must include it manually by dragging it into the Groups & Files list of your project.

    Using relative paths in Xcode for any of the above arguments won’t work since the working directory is set to one of the root directories of the system (e.g. Applications, Developer, Library, or System). (I haven’t had enough time to figure out which one of these it is exactly.)

    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 haven’t tried this on Xcode 4, only Xcode 3. For Xcode 4, you can add mogenerator as a build phase instead of following the following steps.)

    1. Go to the info page of the .xcdatamodel file.
    2. Choose the Comments tab.
    3. Add xmod to the comments field, on its own line.
    4. Every time you save the model, it will regenerate the machine files for you.

    To send parameters, they must be on their own line(s):

    This works:

    xmod
    --base-class CLASS
    --template-path PATH
    

    And even this works:

    xmod
    --base-class CLASS --template-path PATH
    

    But, this won’t work:

    xmod --base-class CLASS --template-path PATH
    

    Note: You must close the Info window for the settings to take effect.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.