Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"Compilation failed for data model at path" when compiling Core Data model after upgrading to lion

Tags:

core-data

After upgrading to lion, the following error prevents successful compilation of a core data model:

core-data-model/MyModel.xcdatamodeld:0: error: Compilation failed for data model at path 'resources/MyModel.momd/MyModel.mom'

This is the result of executing the following command:

/Developer/usr/bin/momc core-data-model/MyModel.xcdatamodeld resources/MyModel.momd

Note that this command is executing in a custom build script independently of xcode, and that it ran without problems before upgrading to Lion.

I've read of model compilation errors after upgrading to Lion (for instance see this question), but the solutions detailed there do not seem to apply.

Anyone else encounter problems manually invoking model compilation after upgrading to Lion? Any ideas? Thanks.

like image 416
Amos Joshua Avatar asked Nov 03 '11 11:11

Amos Joshua


2 Answers

Figured it out - it seems like the object model compiler now expects the destination path to be absolute. This works:

/Developer/usr/bin/momc core-data-model/MyModel.xcdatamodeld /Users/amos/projects/my-project/resources/MyModel.momd

like image 83
Amos Joshua Avatar answered Nov 19 '22 09:11

Amos Joshua


I was also getting this error because I had a bad inverse relationship in my model : enter image description here

I fixed it by splitting it into two inverse relationships : enter image description here

like image 22
Symmetric Avatar answered Nov 19 '22 11:11

Symmetric