• 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: Synchronising across multiple NSUndoManager stacks
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Synchronising across multiple NSUndoManager stacks


  • Subject: Re: Synchronising across multiple NSUndoManager stacks
  • From: Jerry Krinock <email@hidden>
  • Date: Fri, 21 Mar 2008 22:15:17 -0700


On 2008 Mar, 21, at 17:50, Graham Cox wrote:

So the question is, is this a requirement that others have come across and if so, how did you solve it?

Not exactly that requirement, but something like it: I've had to deal with objects that can be moved among open documents. My solution was to use one global undo stack, and also to clear the stack whenever any document was closed.


It looks like all of your documents and objects live in the same "globe". Therefore the global undo stack is the most natural solution. With the Cocoa default scheme, each document having its own undo stack, I even found it difficult to troubleshoot my undo stacks because, as I user, when moving between documents, it was hard for me to say what was ^expected^ behavior when I clicked 'Undo' while this document was active or 'Redo' while that document was active. Whoa! But once I put everything into one undo stack, even I could understand it.

Consider how often that Undo gets used. Then consider how much of your time it is worth to handle all the pathological cases without introducing bugs, and how many other spec requirements for really useful features you need to meet before your deadline. If Undo/Redo works as expected 90% of the time that the user wants it and is grayed out for the other 10%, that may be good enough.

Probably a computer science guru would know for sure, but since none of them have replied for over 4 hours I'll give you my opinion based on engineering common-sense: Trying to solve the general 'Undo' problem is difficult in theory and intractable in practice. Imagine a multi-player networked computer game where, against the advice of intellectuals, you directed your armies to invade another nation five years ago, but now realize that the intellectuals were correct. You see why games don't have 'Undo'.

Now, I see that you've considered a global Undo stack as your second alternative, but I think you could simplify it even further, and move on.
_______________________________________________


Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Synchronising across multiple NSUndoManager stacks
      • From: Graham Cox <email@hidden>
References: 
 >Synchronising across multiple NSUndoManager stacks (From: Graham Cox <email@hidden>)

  • Prev by Date: Re: Correct use of NSViewController
  • Next by Date: XML to RTF transformation via XSL
  • Previous by thread: Synchronising across multiple NSUndoManager stacks
  • Next by thread: Re: Synchronising across multiple NSUndoManager stacks
  • Index(es):
    • Date
    • Thread