Re: Cocoa undo considerations
Re: Cocoa undo considerations
- Subject: Re: Cocoa undo considerations
- From: Jean-François Veillette <email@hidden>
- Date: Wed, 11 Jul 2001 16:07:25 -0400
There was a bug(?unpleasant feature?) in Openstep on archiving /
unarchiving an NSInvocation that was asked to retain its arguments.
If you set you invocation, ask to retainArguments and archive.
Then unarchive, the new invocation doesn't retain the arguments. This
may cause a problem for you if you try to archive the undo stack (as I
was).
It may be fixed in Cocoa now, I don't know.
At least if you have problem on unarchiving, you can quickly focus on
this possible cause.
- jfv
Le Mercredi 11 juillet 2001, ` 03:29, Chris Meyer a icrit :
- Adding undo/redo to methods modifying objects is pretty
straightforward. But when a method removes (delete) an object, this
object should not be deallocated but instead stored in a "saved
objects"
pool (ie, NSMutableArray), so that the invocations stored in the undo
manager stay valid. And that pool should be emptied when one wants to
get rid of the undo stack. Makes sense ?
The object will be retained by the NSInvocation object. You don't
really need to worry about retaining it if its an argument to the
object returned by the prepareWithInvocationTarget: of NSUndoManager.
- Are there other things to have in mind when implementing undo ?
-- _______________________________________________
cocoa-dev mailing list
email@hidden
http://www.lists.apple.com/mailman/listinfo/cocoa-dev