Sunday, August 21, 2011

Adding Core Data to an already existing XCode4 project

  1. The mechanism to add the model is simple:
    Ctrl+Click > New File > Core Data > Data Model > Next > Save
    but this only works if you Ctrl+Click on the project!
    • If you Ctrl+Click anywhere else, for example lets say on the Resources folder, then you will get a useless .xcdatamodeld file which simply won't open in the editor.
    • So make sure to add the model file by Ctrl+Click(ing) on the project name and nothing else.
    • Beware, if try to move it to an appropriate location like Resources at a later time, it will stop working again. After the move, once again, no editor will come up if your try to re-select the .xcdatamodeld file.
    • You must have it directly under the project in order to be able to work with it.

0 comments:

Post a Comment