So I have used CoreData before in my iOS applications, but until now I’ve always sticked to Apple’s CoreData Template Project. Yesterday I came across the MagicalRecord project on GitHub which promises a cleaner and simpler approach to working with CoreData.
At first I was confused on how exactly to set up a new project with CoreData and MagicalRecord. Since there were practically no tutorials / guides on the web on how to use MagicalRecord except of course for the Repository Description, I've decided to write a easy to follow step by step guide.
- Create a new project in XCode and be sure not to check "Use Core Data"
- Download the MagicalRecord source from GitHub and add it to your project
- Add the CoreData framework to your project
- Import the MagicalRecord main header file in the projects .pch file
- In the AppDelegate's application:didFinishLaunchingWithOptions:
Call following method to setup CoreData and MagicalRecord ... see the MagicalRecord GitHub page for more setup possibilities.
Well that was the basic setup, easy right? Now on to the important stuff...
Create
Select
Update
Delete
Save
Misc
Thats pretty much all there is to say about this great library, You can download the source code I created showcasing MagicalRecord integration here: