views:

26

answers:

1

I am developing an iPhone application that has a large database of items which the user can mark as favorite or add to certain lists.

Currently, the SQLite file is first copied from the bundle to the document directory to make it writable and used as a Core Data persistent store. However, I will run into problems when I need to deploy an application update down the track to add extra data or fix minor errors, where the user data will be lost or the application data needs to be synchronised.

After some research I found that perhaps I could add the application data as a read-only persistent store in the bundle and add a second writable persistent store to the documents directory for user data - Core Data would combine the data for me. But then I came across this in the documentation:

When you add stores, you specify the different store attributes by configuration. When you are creating your configurations, though, remember that you cannot create cross-store relationships.

I presume that means that I will not be able to maintain relationships between items and lists or items and a 'favorite' record. I guess I could go to the extra effort of traversing the relationship manually. Has anyone had experience with this?

A: 

Core Data provides an architecture to support versioning of managed object models and migration of data from one version to another. If your changes to the model are pretty simple, you can use "lightweight migrations", which are pretty easy.

Read more in Apple's documentation here: http://developer.apple.com/library/ios/#documentation/Cocoa/Conceptual/CoreDataVersioning/Introduction/Introduction.html

Michal
Ajw
Michal