0

i am using he quartz for drawing the image in my view and now i want to add the undo button in my toolbar button on myipad app.

what is code or any example of doing this.

uttam
  • 1,364
  • 4
  • 20
  • 35
  • 1
    Adding buttons to a UI isn't a particularly interesting "problem". Are you having some particular difficulty with this? Is it the undo functionality itself you are not sure about? – Marcelo Cantos May 29 '10 at 06:42
  • i am having problem with undo functionality.can you give me some kind of help. – uttam May 29 '10 at 07:03
  • If you're curious about how undo / redo works on iPhone OS, you may be interested in this question as well: http://stackoverflow.com/questions/2449268/how-does-undo-redo-basically-work-on-iphone-os – Brad Larson May 29 '10 at 12:20

2 Answers2

0

Store the old state in a stack. When the undo button is pressed, pop the stack and restore the state. Disable the undo button when the stack is empty. Be careful not to run out of memory.

What constitutes "old state" is probably very specific to your application.

rpetrich
  • 32,196
  • 6
  • 66
  • 89