我已經看到這個問題張貼在這裏,但總是,答案是模型已被改變,重置模擬器,刪除商店。可可錯誤134100再次 - (用於打開模型是從用於創建模型不兼容)
我也收到這個錯誤,但是,這是一個新的應用程序。我沒有添加/更改實體或屬性。
我已經刪除了商店,我重置了模擬器,但我得到了相同的結果。
這裏是商店代碼..是否有任何其他原因導致此問題?
- (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_;
}
這裏是控制檯噴涌:
2011-08-03 11:42:38.936詞典[4468:F203] - [AppDelegate中 應用中:didFinishLaunchingWithOptions:] 2011-08-03 11 :42:38.989 Lexicon [4468:f203] - [AppDelegate applicationDocumentsDirectory] 2011-08-03 11:42:39.048 Lexicon [4468:f203]未解決的錯誤錯誤 Domain = NSCocoaErrorDomain Code = 134100「The operation could not completed。(Cocoa error 134100.)「UserInfo = 0x6d3ee60 {metadata = {type =不可變字典, 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 :{內容= 「LexiconEntity」} = {長度= 32, 容量= 32,字節= 0x8698c5295fa5124b78a6b127bba26ff0 ... 70eaece0517cd4c6}}
7:{內容= 「NSStoreUUID」} = {內容=「內容=」SQLite「} 9:{內容=」_NSAutoVacuumLevel「} = {內容=」2「} 10:{內容=」2「} {內容= 「NSStoreModelVersionHashesVersion」} = {值= 3,類型= kCFNumberSInt32Type}},原因=用來打開存儲該模型是 與用於創建存儲}的一個不兼容,{ 元數據= { NSPersistenceFrameworkVersion = 363; NSStoreModelVersionHheshes = { LexiconEntity = < 8698c529 5fa5124b 78a6b127 bba26ff0 f3bc678b a4f1e809 70eaece0 517cd4c6>; }; NSStoreModelVersionHashesVersion = 3; NSStoreModelVersionIdentifiers =( <> ); NSStoreType = SQLite; NSStoreUUID =「86B22D58-28A5-4585-8650-07111B34B43A」; 「_NSAutoVacuumLevel」= 2; }; reason =「用於打開商店的模型與用於創建商店的模型不兼容 」; }