Re: CoreData based document NSUndoManager troubles
Re: CoreData based document NSUndoManager troubles
- Subject: Re: CoreData based document NSUndoManager troubles
- From: Colin Cornaby <email@hidden>
- Date: Thu, 18 Aug 2005 15:17:56 -0700
Removing that line made no changes to the problem. The undo menu is
still not enabled, and the document shows no changes.
I understand that the managed object context and the document share
the same undo manager. I was simply checking to make sure some
underlying process had not failed and that they were indeed using the
same undo manager.
On Aug 18, 2005, at 2:15 AM, mmalcolm crawford wrote:
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:
40mac.com
This email sent to email@hidden
---------------------------
Colin Cornaby
ProToys - White Magic Labs - http://whitemagiclabs.com
Macintosh Specialist - University of Portland - htttp://up.edu
_______________________________________________
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