List: I'm having some trouble solving what I believe is a basic task with Core Data. That is, the proper handling of a v1 user opening a v2 file. I want to disallow it altogether. The app in question targets 10.5 and above and (hopefully) uses automatic versioning / migration. I added a new version of my model, made a little change (just added an attribute), created and configured a mapping model, cleaned my target and built/ran. The v1 document opens in app v2 and the new attribute is ready for use. I can even set some value and save with no problems.
Yay! Then the question occurred to me: "What happens if I open a v2 document in v1 of the app?". The answer: It opens without complaint. I can even make and save changes with no problems. Great! ... wait, what? I expected the "model is different" error to pop up and, at worst, I'd have to catch the error and rephrase it so users actually *understand* it. But it gives no error. Not even an exception. This is a problem. For the change I made, this isn't a big deal. The v1 app knows nothing about this attribute, so it shouldn't hurt anything, and the v2 model specifies this simple float attribute to have a default value of 0, so all bases are covered there. Then I think about more complicated changes. For example, I was perhaps overzealous in my initial design - all those entities and their glorious relationships looking all sexy, spread out on the pages like that, their provocative posture suggesting "fill me with data - go on, I don't mind". What if I need to denormalize? If I do, and a v1 or v2 user opens a v3 document, horror will ensue. In a terrible glimpse of its own future, the younger app will find its older self quite changed. Alas, time has eroded its sexy model, flattening it in some places, causing it to sag in others. And what's that? A mid-life-crisis-induced Entity enlargement? Yes, time has cruelly crushed some of its youthful exuberance, reality has curbed its enthusiasm for lofty models, and necessitated desperate attempts to fit in with an ever-younger 'in-crowd'. What's an app to do? Seriously. I can't find *any* mention in the documentation or anecdotal suppositions *anywhere* on the web to tell me what an app's to do with a newer-versioned Core Data document. I don't want an earlier version opening a later version's documents. It's young and inexperienced ... it wouldn't know what to do with them. I've spent a few hours reading the docs and the list archives, conferring with Google and Zarra's new book - all to no avail. If there are any references I've missed, I'll be embarrassed but grateful for a link. I might even grovel a little. -- I.S. _______________________________________________ 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com