tasos
tasos

Reputation: 33

core data automatic lightweight migration failing on ios5

I have a new version of my model which has one extra attribute in one the entities and nothing else really.

I have setup automatic migration as there is nothing else to migrate,and what happens is that in ios4.3 it works as expected but in ios5 the call to [persistentStoreCoordinator_ addPersistentStoreWithType:NSSQLiteStoreType configuration:nil URL:storeURL options:options error:&error] crashes the app saying bad access.

is there any bug documented regarding migration in ios 5 or has anything changed regarding automatic migration?

I cant get any more info on the specifics of the crash hence my question is quite general, but was just wondering if anyone else has experienced difficulties migrating with ios5?

Upvotes: 0

Views: 249

Answers (2)

christoph
christoph

Reputation: 116

Seems to be a bug in CoreData. Creating a MappingModel and using this options solved the problem for me:

NSDictionary *options = [NSDictionary dictionaryWithObjectsAndKeys:
        [NSNumber numberWithBool:YES], NSMigratePersistentStoresAutomaticallyOption,nil]; 

Upvotes: 2

user1046037
user1046037

Reputation: 17695

I am not sure about what has changed, but in general EXC_BAD_ACCESS errors are usually caused when you try to send a message to a released object.

refer Break on EXC_BAD_ACCESS in XCode?

Upvotes: 0

Related Questions