Re: Core Data Lightweight Migration Woes
Re: Core Data Lightweight Migration Woes
- Subject: Re: Core Data Lightweight Migration Woes
- From: Steve Steinitz <email@hidden>
- Date: Fri, 20 Aug 2010 16:21:49 +1000
Hi Brad,
After much struggle and even writing a nightmare migrator app, I
discovered one day that the lightweight migration really does work.
In broad brush strokes here's what I did:
- Removed all the complicated migration support code that had
never worked...
- ...except the code that ensured that the options dictionary
which is passed to addPersistentStoreWithType included these two options:
NSMigratePersistentStoresAutomaticallyOption
NSInferMappingModelAutomaticallyOption
- Made sure the old and new models were both in the xcdatamodeld
package and that the new one was the 'Current' one (litte green
dot on the icon).
- Removed any stray mopping models, just in case
- Cleaned (important, I think) and launched the application
- Watched with delight (and woke my family) when it created a
new database and archived the old one.
But you probably know all that already.
Cheers,
Steve
_______________________________________________
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