objective-cmogenerator

Why can't MoGenerator find my model?


I am getting this error:

mogenerator: error loading file at PT1/unitTestTLSync/UnitTestModel.xcdatamodeld/UnitTestModel.xcdatamodel: no such file exists

The script line is this:

mogenerator  --template-var arc=true --includeh PT1/unitTestTLSync/UnitTestManagedObjects.h -m PT1/unitTestTLSync/UnitTestModel.xcdatamodeld/UnitTestModel.xcdatamodel -O PT1/unitTestTLSync

Edit: I realized I left out important information. The model in question is part of a unit test only, not the product. I believe the model is being compiled when the unit test is run, but I am not certain about that.

I have double, triple, quadruple checked the spelling and case. I tried -m PT1/unitTestTLSync/UnitTestModel.xcdatamodeld with the same result. This is a new data model specifically created for the unit test.

I have another MoGen set up for the App data model and it works like a charm. Can anyone help me here?

-Bob


Solution

  • I created a product called PT1 and put it in a folder called PT1. XCode created another folder called PT1 below it, where most of the project is. Parallel to the second PT1 is the unit test targets. So, the fix was to remove "PT1/" from the front of all the paths. The structure looks like this. I suspect the confusion is not uncommon, nevertheless bonehead.

    PT1
     |--PT1
     |--unitTestTLSync
         |--UnitTestModel.xcdatamodeld