In my application I'm using Core Data stuff to enable persistent data saving. Since I've seen that mogenerator provides a good approach to create and maintain NSManagedObject
subclasses (also with additional functionalities), I'm looking for some tips for integrating monogenerator within Xcode 4?
P.S. The question has been submitted based on share your knowledge, Q&A-style.
For Xcode 4.5+, the easiest way is to setup a "Pre-action" in your scheme:
Paste this in the text area:
# Update the mogenerator files
cd ${SOURCE_ROOT}/${PROJECT_NAME}
/usr/bin/mogenerator --template-var arc=true -m ${PROJECT_NAME}.xcdatamodeld -M CoreData/Machine -H CoreData/Human`
Hit "OK" and build
A directory named "CoreData" will be created in your source file area along with the subdirectories "Human" and "Machine". You should now add the "CoreData" folder to your project.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With