I have seen this question posted here, but always, the answer is that the model has been changed, reset the simulator, remove the store.
I am also getting this error, however, this is a new app. I have not added/changed entities nor attributes.
I've deleted the store, I've reset the simulator, but I get the same results.
Here is the store code.. Is there any other cause for this problem?
- (NSManagedObjectModel *)managedObjectModel {
// NSLog(@"%s", __FUNCTION__);
if (managedObjectModel_ != nil) {
return managedObjectModel_;
}
NSString *modelPath = [[NSBundle mainBundle] pathForResource:@"Lexicon" ofType:@"momd"];
NSURL *modelURL = [NSURL fileURLWithPath:modelPath];
managedObjectModel_ = [[NSManagedObjectModel alloc] initWithContentsOfURL:modelURL];
return managedObjectModel_;
}
/**
Returns the persistent store coordinator for the application.
If the coordinator doesn't already exist, it is created and the application's store added to it.
*/
- (NSPersistentStoreCoordinator *)persistentStoreCoordinator {
if (persistentStoreCoordinator_ != nil) {
return persistentStoreCoordinator_;
}
NSURL *storeURL = [NSURL fileURLWithPath: [[self applicationDocumentsDirectory] stringByAppendingPathComponent: @"dict.sqlite"]];
NSError *error = nil;
persistentStoreCoordinator_ = [[NSPersistentStoreCoordinator alloc] initWithManagedObjectModel:[self managedObjectModel]];
if (![persistentStoreCoordinator_ addPersistentStoreWithType:NSSQLiteStoreType configuration:nil URL:storeURL options:nil error:&error]) {
NSLog(@"Unresolved error %@, %@", error, [error userInfo]);
abort();
}
return persistentStoreCoordinator_;
}
Here is the console spew:
2011-08-03 11:42:38.936 Lexicon[4468:f203] -[AppDelegate application:didFinishLaunchingWithOptions:] 2011-08-03 11:42:38.989 Lexicon[4468:f203] -[AppDelegate applicationDocumentsDirectory] 2011-08-03 11:42:39.048 Lexicon[4468:f203] Unresolved error Error Domain=NSCocoaErrorDomain Code=134100 "The operation couldn’t be completed. (Cocoa error 134100.)" UserInfo=0x6d3ee60 {metadata={type = immutable dict, count = 7, entries => 2 : {contents = "NSStoreModelVersionIdentifiers"} = {type = immutable, count = 1, values = ( 0 : {length = 0, capacity = 0, bytes = 0x} )} 4 : {contents = "NSPersistenceFrameworkVersion"} = {value = +363, type = kCFNumberSInt64Type} 6 : {contents = "NSStoreModelVersionHashes"} = {type = immutable dict, count = 1, entries => 0 : {contents = "LexiconEntity"} = {length = 32, capacity = 32, bytes = 0x8698c5295fa5124b78a6b127bba26ff0 ... 70eaece0517cd4c6} }
7 : {contents = "NSStoreUUID"} = {contents = "86B22D58-28A5-4585-8650-07111B34B43A"} 8 : {contents = "NSStoreType"} = {contents = "SQLite"} 9 : {contents = "_NSAutoVacuumLevel"} = {contents = "2"} 10 : {contents = "NSStoreModelVersionHashesVersion"} = {value = +3, type = kCFNumberSInt32Type} } , reason=The model used to open the store is incompatible with the one used to create the store}, { metadata = { NSPersistenceFrameworkVersion = 363; NSStoreModelVersionHashes = { LexiconEntity = <8698c529 5fa5124b 78a6b127 bba26ff0 f3bc678b a4f1e809 70eaece0 517cd4c6>; }; NSStoreModelVersionHashesVersion = 3; NSStoreModelVersionIdentifiers = ( <> ); NSStoreType = SQLite; NSStoreUUID = "86B22D58-28A5-4585-8650-07111B34B43A"; "_NSAutoVacuumLevel" = 2; }; reason = "The model used to open the store is incompatible with the one used to create the store"; }