Modifying the data model
Modifying the data model
- Subject: Modifying the data model
- From: Timothy Larkin <email@hidden>
- Date: Sun, 28 Aug 2005 09:20:14 -0400
I create an application with a data model. I run the application and
create a CoreData file. In the course of further development, I make
modifications to the data model. When I next run the application,
the data file I had previously created can't be used. The system
throws some exceptions that say, basically, "You've changed the data
model, so I don't know how to interpret the file created with the old
data model."
On the surface, I can understand the problem. But surely this can't
be the end of the story. If CoreData cannot cope with a modification
of the data model without invalidating all previous data files, then
it is a great step backwards from the old NSArchiving classes.
Because if I can't change the data model, the set of possible
upgrades to the application is seriously limited. Which could not
possibly be the case.
I have been able to find one cryptic sentence in the documentation
about this situation. "If you need to modify a model that is in use,
create a copy, modify the copy, and then discard the objects with the
old model." The two steps are clear enough, but I'm not clear about
what is involved in the third step.
Since I have not been able to track down any traffic on this problem,
I assume that there's a solution which is clear to everyone else. I
will be much obliged if someone would take pity and let me in on the
secret.
Tim Larkin
Abstract Tools
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden