Hallo, zwei Fragen dazu,
Ab welchem Punkt darf ich ein Entity editieren bevor ich die Meldung bekomme :
Ein Problem mit LeichtWeightMigration :
Code von Apple.
Alles anzeigen
Ich weiss nicht wie ich storeURL bekomme.
Gruss an meine Verehrer
Uwe
Ab welchem Punkt darf ich ein Entity editieren bevor ich die Meldung bekomme :
[b]reason=The model used to open the store is incompatible with the one used to create the store[/b]
Ein Problem mit LeichtWeightMigration :
Code von Apple.
Quellcode
- -(void)lightweightMigration
- {
- NSURL * storeURL; // ??
- NSManagedObjectModel * mom = [self managedObjectModel];
- NSPersistentStoreCoordinator *psc = [[NSPersistentStoreCoordinator alloc] initWithManagedObjectModel:mom];
- NSDictionary *options = @{NSMigratePersistentStoresAutomaticallyOption: @YES, NSInferMappingModelAutomaticallyOption: @YES};
- NSError *error = nil;
- if (![psc addPersistentStoreWithType:NSSQLiteStoreType configuration:nil URL:storeURL options:options error:&error])
- {
- NSAssert(NO, @"Unable to load persistent store: %@\n%@",
- [error localizedDescription], [error userInfo]);
- NSLog(@"%@ \n",[error localizedDescription]);
- NSLog(@"%@ \n",[error userInfo]);
- }
- }
Gruss an meine Verehrer
Uwe
Als ich ein kleiner Junge war, habe ich mir gedacht: Wenn ich groß bin möchte ich so sein wie ich.