Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adding Core Data to an existing iPhone app

I have started my application and now I want to add Core Data to my app. How can I add it?

like image 994
uttam Avatar asked Jan 08 '10 07:01

uttam


2 Answers

I disagree that you have to start a new project. It's actually pretty easy to integrate CoreData into an existing project - a good starting point is to create a new CoreData project, but copy the code it generates into your existing project (examine carefully the app delegate to see what it sets up). There's really not that much code involved, and it's easy to create new data models.

It's also a really good idea to work through Apple's CoreData tutorials to understand what is going on, and there are some good books as well.

like image 155
Kendall Helmstetter Gelner Avatar answered Oct 02 '22 23:10

Kendall Helmstetter Gelner


Unless you've gotten really far into your app, the easiest way will be for you to start a new Xcode project using the Core Data template. If you really don't want to move your code into a new project, you can add the Core Data framework and the necessary boilerplate code in AppDelegate. But really, unless you want to be tinkering for a while, the simplest way is to make a new project with the right template.

like image 41
Jonathan Sterling Avatar answered Oct 02 '22 22:10

Jonathan Sterling