3

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,

Hoang Pham
  • 6,899
  • 11
  • 57
  • 70

2 Answers2

2

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 Lamouroux
  • 7,414
  • 29
  • 46
1

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.

Community
  • 1
  • 1
Convolution
  • 2,351
  • 17
  • 24
  • 2
    I would strongly recommend using Core Data over SQLite directly. It offers a higher level of abstraction and better performance. – gerry3 Feb 01 '10 at 20:56
  • agree with gerry3, it has the NsFetchedResultsController which integrates very well with Table View – Hoang Pham Feb 01 '10 at 22:59