views:

83

answers:

2

Hi,

I decided to switch to use Core Data to save all the data in my navigation application. What are the steps necessary to make Core Data available in my application?

I don't want to start a new project with the check box 'Use Core Data for my application' and copy all the existing codes to the new project.

Anybody has any guides or tutorial?

Thanks,

+1  A: 

Similar question here with answer: Adding Core Data To My iPhone App

Also here is the link to Apple's Core Data Tutorial As a side note you don't have to use Core Data, you can use SQL Lite, I have found it to be a little easier starting out if you are all ready familiar with the basics of SQL.

Convolution
I would strongly recommend using Core Data over SQLite directly. It offers a higher level of abstraction and better performance.
gerry3
agree with gerry3, it has the NsFetchedResultsController which integrates very well with Table View
sfa
+2  A: 

You need a CoreData stack consisting of:

  1. NSPersistentStoreCoordinator

  2. NSManagedObjectModel

  3. NSManagedObjectContext

The easiest is probably to create a dummy project with CoreData enabled and then to copy the stack from the App-Delegate to your project. Don't forget to link in the CoreData Framework.

Felix
ohh, so there's no magic called "refactor the project to use Core Data" in xCode :D thanks anyway ;)
sfa