NSUndoManager -removeActionsWithTarget: does nothing
NSUndoManager -removeActionsWithTarget: does nothing
- Subject: NSUndoManager -removeActionsWithTarget: does nothing
- From: Jeremy Dronfield <email@hidden>
- Date: Fri, 5 Mar 2004 11:36:37 +0000
With inestimable and very patient help from Dustin, I'm close to
surmounting my problems with undo management for multiple text views.
My trouble now comes down to one issue: I can't get
-removeActionsWithTarget: to work. I'm implementing it in the -dealloc
method of the delegate of one of my views (the one in the drawer
attached to my main window). When my drawer closes, its delegate calls
the removeActions method, but the undos remain on the stack. These
undos are of the simple "Undo Typing" variety. I've tried passing
various targets - self, [self myTextView] etc - and various receivers -
[self undoManagerForTextView:myTextView], [[myTextView window]
undoManager] etc, but none has any effect.
The problem seems to be with the receiver/target formulation rather
than the undo manager itself, since substituting a simple [[self
undoManagerForTextView:myTextView] removeAllActions] behaves exactly as
advertised, neatly removing all undos for both views. Another
possibility - does this method only remove undos registered explicitly
with -prepareWithInvocationTarget or -registerUndoWithTarget?
-Jeremy
========================================
email@hidden
theLocustFarm.net:
- fractious fiction at
http://freespace.virgin.net/jeremy.dronfield
========================================
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.