I'm having a very curious problem performing a CoreData Migration.
Basically, I have 2 entities, where in one of them I add a property and in the other, I change a property type from NSString to NSArray(Transformable). So far, so good, it works well, tests were made and the data integrity was intact after the migration.
The problem happens if I run the exact same code on Xcode 5 (I don't know if it's related to iOS SDK 7.0 or Xcode 5), but the migration runs and corrupts the data.
I ended up creating a simple project to demonstrate what's happening. https://dl.dropboxusercontent.com/u/1393279/CoreDataMigration.zip
The steps to reproduce is: - On Xcode 5 (iOS SDK 7.0), you can use the simulator -
1 - Open the project "BeforeMigration" and execute. See the logs and data created, no problem so far;
2 - Stop the project;
3 - Open the project "AfterMigration", build and run.
4 - See that the migration is executed, but the data gets corrupted:
2013-11-13 12:22:29.778 CoreDataMigration[7223:70b] CoreData: error: exception during fetchRowForObjectID: * -[NSKeyedUnarchiver initForReadingWithData:]: incomprehensible archive (0x43, 0x32, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0) with userInfo of (null) 2013-11-13 12:22:29.782 CoreDataMigration[7223:70b] Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '** -[NSKeyedUnarchiver initForReadingWithData:]: incomprehensible archive (0x43, 0x32, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)'
AFAIK, incomprehensible archive means corrupted data on CoreData.
What's difficult to understand is that the same exact code worked before, so, if it's a logic problem, it should have happened on Xcode 4.5. I looked for CoreData Diffs but didn't find anything relevant.
If anyone have any idea of what could be the problem, I would appreciate. Thanks.