Saving Managed Object Context
Saving Managed Object Context
- Subject: Saving Managed Object Context
- From: "Ayers, Joseph" <email@hidden>
- Date: Mon, 23 Aug 2010 12:33:32 -0400
- Acceptlanguage: en-US
- Thread-topic: Saving Managed Object Context
Attempting to save a NSManagedObjectContext with:
NSError *error = nil;
if (![[self managedObjectContext] save: &error]) {
NSLog(@"Error while saving\n%@",
([error localizedDescription] != nil) ? [error localizedDescription]: @"Unknown Error");
Results in:
2010-08-22 20:31:32.385 Roboplasm[3508:a0f] Error while saving
TapeList is a required value.
TapeList is the base entity in my object graph and is inserted into the context with:
NSManagedObjectModel *mom = [self managedObjectModel];
...
NSEntityDescription *tapeListEntity = [[mom entitiesByName] objectForKey:@"TapeList"];
NSLog(@"TapeList Entity: %@", tapeListEntity);
// [self setValue:tapeListEntity forKey:@"TapeList"];
[self setTapeList:[NSEntityDescription insertNewObjectForEntityForName:@"TapeList" inManagedObjectContext:[self managedObjectContext]]];
Any idea what's going on here?
Thanks,
Joseph Ayers
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden