• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Cocoa undo considerations
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Re: Cocoa undo considerations (From: Chris Meyer <email@hidden>)

  • Prev by Date: Creating NSLock ?
  • Next by Date: NSOutlineView eats modifiers?
  • Previous by thread: Re: Cocoa undo considerations
  • Next by thread: Re: Cocoa undo considerations
  • Index(es):
    • Date
    • Thread