0

Possible Duplicate:
Adding Core Data to existing iPhone project

how can I add core data into an existing iOS project? I added the data model file, created the data models from it and added the three properties into my app delegate all into my existing(!) project. I also added CoreData into the frameworks.

In my app delegate's didFinishLaunching-method I call [self managedObjectContext], but it returns nil. I guess I have to override the getter methods and load my data model from there? How do I do that?

Community
  • 1
  • 1
user975561
  • 490
  • 1
  • 5
  • 16
  • 2
    This has already been asked [here](http://stackoverflow.com/q/2032818/730701) and [here](http://stackoverflow.com/q/6821719/730701). – Adam Oct 02 '12 at 14:18

1 Answers1

7

Easiest way to do this is to create a new project (Empty project) and make sure Core Data is added in. Then, just look over the differences, there should be four big ones:

  1. Add in all the stuff that is created in the AppDelegate
  2. Add in the Core Data framework
  3. Add your data object
  4. Modify the pch file
LJ Wilson
  • 14,327
  • 5
  • 34
  • 57