2

I'm using core data in my app to store all the car attributes for cars used in my game. The user can select different parts (engines, wheels, etc) which are then flagged in the datastore as being selected, so some of the data in the datastore can be changed by the user.

My question is similar to this, if I want to add a new car, how do I go about this once the app has shipped without overwriting the changes made by the user? The model hasn't changed, so i guess versioning is out. I know how to add data programmatically, but what is the best way to test if the database has already been updated with the new data?

Community
  • 1
  • 1
Gravedigga
  • 197
  • 2
  • 7

1 Answers1

0

All you really need to do is new objects to your persistent store.Depending on what way you put the new data in your app,you write methods, that add new Car objects, without touching users data anf flags, just create new one, as you did when you prepopulated your database.

Nikita Pestrov
  • 5,876
  • 4
  • 31
  • 66
  • Thanks for your response Nikita. In the end I opted to remove the user editable data from the Datastore - probably something I should have done from the start. Now the Datastore is read from the bundle when the app is executed, so the user automatically gets access to the latest records. – Gravedigga Jun 28 '12 at 16:49