Thanks for the links. In the end by comparing two XML files by hand, I was able to see that in my development version of the model one entity had a new property in it, which should only have been in version 3, but was in fact in both version 3 and version 2, and the user's data file was version 2. Anyway, thanks for the links and the clues. I could see the differences in the models by comparing the hashes of each entity.
And a warning to others: I believe this happened because in some previous version of Xcode 4, when you added a model version, the new version appeared in the project navigator and was selected, but the version in the editor was still the previous version. And since one is a duplicate of the other, it's very easy to assume the editor has the new one, and start editing. I've since learned that I need to select some other file, then the new model version in the project navigator to ensure the editor is showing the correct model version. Not sure if this 'feature' still exists. Cheers, Martin On Sep 3, 2012, at 03:55 AM, Jerry Krinock <je...@ieee.org> wrote: > > On 2012 Sep 01, at 04:20, Martin Hewitson <martin.hewit...@aei.mpg.de> 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%2BSSYMetadata.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 (Cocoa-dev@lists.apple.com) > > 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: > https://lists.apple.com/mailman/options/cocoa-dev/martin.hewitson%40aei.mpg.de > > This email sent to martin.hewit...@aei.mpg.de
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com