Guest User

Untitled

a guest
May 2nd, 2012
173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.65 KB | None | 0 0
  1. Copy existing xcdatamodel into a new project - Can't find model for source store
  2. Unresolved error Error Domain=NSCocoaErrorDomain Code=134130 "The operation couldn’t be completed. (Cocoa error 134130.)" UserInfo=0x1894f60 {URL=file://localhost/var/mobile/Applications/15214BCA-379F-4A2D-BE40-80F0CC25B50B/Documents/History.sqlite, metadata=<CFBasicHash 0x5b7880 [0x3f3c3630]>{type = immutable dict, count = 7,
  3. entries =>
  4. 2 : <CFString 0x5b79a0 [0x3f3c3630]>{contents = "NSStoreModelVersionIdentifiers"} = <CFArray 0x5b7a80 [0x3f3c3630]>{type = immutable, count = 0, values = ()}
  5. 4 : <CFString 0x5b79d0 [0x3f3c3630]>{contents = "NSPersistenceFrameworkVersion"} = <CFNumber 0x5b7c00 [0x3f3c3630]>{value = +386, type = kCFNumberSInt64Type}
  6. 6 : <CFString 0x5b7a00 [0x3f3c3630]>{contents = "NSStoreModelVersionHashes"} = <CFBasicHash 0x5b7aa0 [0x3f3c3630]>{type = immutable dict, count = 0,
  7. entries =>
  8. }
  9.  
  10. 7 : <CFString 0x3eb4cf40 [0x3f3c3630]>{contents = "NSStoreUUID"} = <CFString 0x5b7d10 [0x3f3c3630]>{contents = "6FED3F04-493F-4A5B-9423-05475B6F3E0B"}
  11. 8 : <CFString 0x3eb4cde0 [0x3f3c3630]>{contents = "NSStoreType"} = <CFString 0x3eb4cdf0 [0x3f3c3630]>{contents = "SQLite"}
  12. 9 : <CFString 0x5b7a30 [0x3f3c3630]>{contents = "_NSAutoVacuumLevel"} = <CFString 0x561a40 [0x3f3c3630]>{contents = "2"}
  13. 10 : <CFString 0x5b7a50 [0x3f3c3630]>{contents = "NSStoreModelVersionHashesVersion"} = <CFNumber 0x182b780 [0x3f3c3630]>{value = +3, type = kCFNumberSInt32Type}
  14. }
  15. , reason=Can't find model for source store}, {
  16. URL = "file://localhost/var/mobile/Applications/15214BCA-379F-4A2D-BE40-80F0CC25B50B/Documents/History.sqlite";
  17. metadata = {
  18. NSPersistenceFrameworkVersion = 386;
  19. NSStoreModelVersionHashes = {
  20. };
  21. NSStoreModelVersionHashesVersion = 3;
  22. NSStoreModelVersionIdentifiers = (
  23. );
  24. NSStoreType = SQLite;
  25. NSStoreUUID = "6FED3F04-493F-4A5B-9423-05475B6F3E0B";
  26. "_NSAutoVacuumLevel" = 2;
  27. };
  28. reason = "Can't find model for source store";
  29. }
  30.  
  31. NSDictionary *options = [NSDictionary dictionaryWithObjectsAndKeys: [NSNumber numberWithBool:YES], NSMigratePersistentStoresAutomaticallyOption, [NSNumber numberWithBool:YES], NSInferMappingModelAutomaticallyOption, nil];
  32.  
  33. - (NSManagedObjectModel *)managedObjectModel {
  34.  
  35. if (managedObjectModel_ != nil) {
  36. return managedObjectModel_;
  37. }
  38. NSString *modelPath = [[NSBundle mainBundle] pathForResource:@"DATABASENAME" ofType:@"momd"];
  39. NSURL *modelURL = [NSURL fileURLWithPath:modelPath];
  40. managedObjectModel_ = [[NSManagedObjectModel alloc] initWithContentsOfURL:modelURL];
  41. return managedObjectModel_;
  42. }
Advertisement
Add Comment
Please, Sign In to add comment