Bjarke
Bjarke

Reputation: 1295

Adding exsisting classes to core data model

I have a iphone application in which I use nsecoding for saving my objects. However it has been decided that it should be saved using core data.

The questions is - what is the best way to convert my exsisting model classes to datacore classes. Should I create a new thorugh the xdatamodel editor and replace the old or what is the best strategy. I have not figure out an easy way to do this :P

Regards

Bjarke

Upvotes: 0

Views: 74

Answers (1)

Monolo
Monolo

Reputation: 18253

Roughly, what you will need to do is this:

Create a data model that reflects the classes that you have already created - and I think you'll have to do it by hand in the model editor.

Then change your classes so they become subclasses of NSManagedObject. You'll have to make sure your properties are restricted to types handled by Core Data, of course.

Upvotes: 1

Related Questions