Re: core data stores, versioning
Re: core data stores, versioning
- Subject: Re: core data stores, versioning
- From: Jerry Krinock <email@hidden>
- Date: Sun, 02 Sep 2012 18:55:14 -0700
On 2012 Sep 01, at 04:20, Martin Hewitson <email@hidden> wrote:
> 1) Can one determine the version of a model from it's core data store file (XML) ?
> 2) Can one determine the corresponding version number of the models in Xcode ?
If I remember correctly, models are identified by UUIDs. The normal method is to iterate through all the available models you have until you find one for which -[NSManagedObjectModel isConfiguration: compatibleWithStoreMetadata:]. You might learn something from here…
https://github.com/jerrykrinock/ClassesObjC/blob/master/SSYPersistentDocumentMultiMigrator.m
I think that the UUID itself is in the store's metadata, which you can learn how to dig into here…
https://github.com/jerrykrinock/CategoriesObjC/blob/master/NSPersistentDocument+SSYMetadata.m
> 3) Can one somehow reconstruct (if even by hand) a core data model from a store file?
It may be different with an XML store, but with an sqlite store, you could look at the tables in the store. Tables correspond to entities, etc. A GUI tool like SQLIteManager is handy.
_______________________________________________
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