processPendingChanges and disableUndoRegistration
processPendingChanges and disableUndoRegistration
- Subject: processPendingChanges and disableUndoRegistration
- From: "christophe mckeon gonzalez de leon" <email@hidden>
- Date: Thu, 25 Dec 2008 17:37:49 -0800
hi,
in the NSPersistentDocument Core Data tutorial, apple includes
the below code. my question is whether there should not also
be another call to processPendingChanges before the call
to disableUndoRegistration? i have seen several examples
of code online which do call it twice, and it would seem to
make more sense.
thanks for any tips,
_c
- (id)initWithType:(NSString *)type error:(NSError **)error
{
self = [super initWithType:type error:error];
if (self != nil) {
NSManagedObjectContext *managedObjectContext = [self
managedObjectContext];
[[managedObjectContext undoManager] disableUndoRegistration];
self.department = [NSEntityDescription
insertNewObjectForEntityForName:@"Department"
inManagedObjectContext:managedObjectContext];
[managedObjectContext processPendingChanges];
[[managedObjectContext undoManager] enableUndoRegistration];
}
return self;
}
_______________________________________________
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