[Solved] How to “undo” when we draw in iPhone SDK? [closed]


First of all please specify what do you use to draw. Do you use any API or Core-Graphics Framework for drawing.

Here are some of the approaches from the link I found.

Approach:

  1. on touchesEnded, save the image to app sandbox with a name like.. 1.png, 2.png etc. then put a count on “undo” variable. when user press undo, just loads the old image base on the count. (this is what I can think of roughly, but haven’t gone through the coding of it yet, but sounds pretty simple to code).

  2. NSUndoManager.

Hope this helps for anyone else looking to do this.

Reference Link:

http://www.iphonedevsdk.com/forum/iphone-sdk-development/46996-drawing-app-how-do-undo.html

Cheers

solved How to “undo” when we draw in iPhone SDK? [closed]