Re: CoreData based document NSUndoManager troubles
Re: CoreData based document NSUndoManager troubles
- Subject: Re: CoreData based document NSUndoManager troubles
- From: mmalcolm crawford <email@hidden>
- Date: Thu, 18 Aug 2005 02:15:44 -0700
On Aug 17, 2005, at 3:13 PM, Colin Cornaby wrote:
Didn't fix anything. Here is my full method that needs to be undone:
NSData *oldData = [self valueForKey:@"data"];
[self setValue:someData forKey:@"data"];
[[[self managedObjectContext] undoManager]
registerUndoWithTarget:self
selector:@selector(setResourceData:)
object:oldData];
[[[self managedObjectContext] undoManager]
setActionName:@"Edit Resource"];
As Bill stated in his first reply, there should be no need for this
line:
[[[self managedObjectContext] undoManager]
registerUndoWithTarget:self
selector:@selector(setResourceData:)
object:oldData];
It's not clear why you still think it is necessary. It is almost
certainly contributing to (if not actually representing the root
cause of) any problems you might be seeing. What are you trying to
achieve?
They look to be the same Undo Manager. I'm NSLogging at init, and
NSLogging when I add the undo step, and they are both at the same
address in memory.
"In a persistent document the undo manager functionality is taken
over by managed object context."
<http://developer.apple.com/documentation/Cocoa/Reference/
ApplicationKit/ObjC_classic/Classes/NSPersistentDocument.html#//
apple_ref/doc/uid/TP30001179-CJBFFIIJ>
See also: <http://developer.apple.com/documentation/Cocoa/Reference/
ApplicationKit/ObjC_classic/Classes/NSPersistentDocument.html#//
apple_ref/doc/uid/TP30001179-CJBJEIAF>
mmalc
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden