Check over your model when mogenerator isn’t working

This is not a very lengthly post but it might help someone out. I like to use mogenerator and Xmo’d to generate my core data model classes rather than using the standard code generator included in xcode.

Usually everything works beautifully with my classes generating as expected when I save my data model. However, I have run into two cases where the old classes are removed but the new classes are never generated. When this happens, looking at the crash in won’t be of much help because the location of the crash in the mogenerator source simply states that the model failed to load with no reason given.

Both of the causes were errors on my part. The first being I added an attribute to an entity but did not assign a type to it. The second being I apparently added an entity that had some sort of name collision. The entity in question was named “List” and when I renamed it to “DSList”, the model classes generated without an issue.

Hopefully this will save someone time and give them an idea of what to look for.


One Response to “Check over your model when mogenerator isn’t working”

  1. Markk on October 17th, 2012 4:09 pm

    Thanks for this, it did help.

    For me, it wasn’t working because I had forgotten to set the Class for my entities. Once I fixed that, all was good.