CoreData Migration, Permanent Stores, and Temporary Files
CoreData Migration, Permanent Stores, and Temporary Files
- Subject: CoreData Migration, Permanent Stores, and Temporary Files
- From: Niko Matsakis <email@hidden>
- Date: Sat, 20 Jan 2007 18:18:14 +0100
Hello,
I am trying to add some migration to a CoreData-based app and running
into trouble. I have been reading the Migration example, and I
*think* I understand how one is supposed to go about the upgrade.
As I understand it, the overall process for upgrading a file from an
older model is to create a series of NSManagedObjectContext
instances, one for each model between the model on disk and the
latest object model. You then run code which copies the objects over
from the older models into the newer ones, and eventually you have an
upgraded version.
Now --- my question is this: for each of these intermediate
NSManagedObjectContext instances, a persistent store must be
provided, right?
In this case, should I simply create temporary files (I assume there
is some cocoa API for such a thing)?
Also, it doesn't seem possible then to upgrade a file in place (as
that would require creating two NSManagedObjectContext instances,
each with a persistent store that had the same path, but different
models). Is the idea here to upgrade to a temporary file, then copy
it over and replace the older file?
Thanks for any advice!
Niko
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden