Re: Deleting a Core Data stack directory
Re: Deleting a Core Data stack directory
- Subject: Re: Deleting a Core Data stack directory
- From: "Marcus S. Zarra" <email@hidden>
- Date: Thu, 5 Jul 2007 18:04:43 -0600
What you need to do is migrate the repository to a new repository
that uses the new model.
What I do is store the model number in the meta data of the
persistent store. Then on start up I check this against what the
"current" model number is and use that to determine if a migration is
necessary. If one is then I use the migration code I wrote
(available at http://code.google.com/p/maccode/) to move the data to
the new repository.
Marcus S. Zarra
Zarra Studios LLC
Simply Elegant Software for OS X
www.zarrastudios.com
On Jul 5, 2007, at 5:30 PM, Andrew Merenbach wrote:
Hi, all,
I have a non-document-based, Core Data application. When upgrading
to a new version, the stack entities in certain cases will have
different attributes due to a new version of my data model.
In these cases I sometimes get an error due to the incompatibility
between the two versions of the program.
I have created a "Stack Reset" program that removes the program's
directory in the Application Support folder, but I'm wondering
whether there's a better way to handle migration.
Is there a way to detect incompatibilities and reset the Core
Data's stack directory without resorting to an external program?
It seems a bit hackish to delete the stack folder while the program
is running--I can imagine that Bad Things might happen.
Cheers,
Andrew
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please 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:
40zarrastudios.com
This email sent to email@hidden
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please 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