core-dataxcode5core-data-migrationmogenerator

What do I do with the mogenerator files that were generated?


I finally got mogenerator to work, that is, it generated four (4) files for each entity (a .h file, a .m file and two more .h and .m files prefixed with an underscore). I noticed that I have the same identical files (without the underscore) already in my app; the difference is the older ones have program logic in them and the new ones are empty of any logic.

enter image description here

Somewhere I read that I have to put the new files in my app, but if I do that, I will wipe out the ones with the logic in them. So, what do I do now?


Solution

  • The files with the underscore are the "machine" classes and are written each time you build the project. The files without underscore are the "human" classes and are only created once and never replaced. The human class files should contain your custom logic.

    If you had previously added code to the Xcode generated managed object subclass files, move that to the mogenerator human class files.