Re: Programmatic Core Data Migration
Re: Programmatic Core Data Migration
- Subject: Re: Programmatic Core Data Migration
- From: tshanno <email@hidden>
- Date: Tue, 26 Feb 2013 09:59:15 -0600
On Feb 25, 2013, at 6:28 PM, Michael Swan <email@hidden> wrote:
> Tom,
> I've never built a data model programmatically but I'm guessing it works like building a nib in code where it happens on each launch. This means that when you move to version 2 of your data model you will have to build model 1 and 2 on each launch. If this is still just for you to use at the moment you can drop older versions once you know you have moved all of you stores up to the newest version. The data model from any release versions will need to stick around forever (or at least a good long time).
[slapping head] I see. *I* don't need the old versions because once my model is migrated the program will never have to deal with an older version of the model again. As long as the program has never been released, it will never have to deal with older object models. But once its released, the older model from version 1 is going to be a permanent fixture in order for users of version 1 to be able to migrate to a newer object model.
> Out of curiosity, what is the reasoning behind building the model in code rather than with the data model editor? The data editor is pretty stable from what I have seen and is super easy to use. If it is because of a visual impairment perhaps you could write your own app that allows you to specify the model's structure in text and converts it to a model file that can be saved as though Xcode had built it. That would eliminate the overhead of building the model at every launch and be easier to do with VoiceOver.
I should have used the data model editor. But the truth is that when I started this thing I was a rank beginner. I don't know when you get to drop that title but I'm guessing I probably still deserve it. I'm coming from a background in C and I was (and am) much more comfortable working in code. I was trying to learn objective C at the same time I was trying to learn to use XCode and IB and I didn't understand what was going on. The Core Data Utility Tutorial in the docs that demonstrated the use of core data without the interface looked straight forward and I thought I understood it. On the other hand, the data model editor looked like the kind of black box that would save a lot of time but which I would regret using if I ever wanted to do anything unusual.
I was wrong, of course. Things are fine as they are but if I had it to do over, I'd use the editor.
Thanks for all the help. That was a great response and I really appreciate the time.
Tom S.
_______________________________________________
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