Thursday, October 13, 2011

new iphone Tutorials

NSUndoManager

Undo/redo capabilities are provided by the NSUndoManager class. The class, documented here, works by keeping a stack of messages that, if sent, would serially undo the last action, the penultimate action, and on back until arriving at the initial state.
Let’s use an example to illustrate how this works: our city, concerned with a perceived increase in the number of trucks plying our streets, has commissioned a census. City workers will tally truck traffic using an iPhone app. See a truck, tap a button. Oops! Mistook that Subaru Forester for a truck? Shake to undo.
We’ll start with working code that lacks undo/redo and add those capabilities. Grab the code to follow along:
Source/GitHub
The code for this tutorial is available on GitHub. To download a copy for yourself, clone the repository:
  1. Open a terminal and change to the directory where you want the code
  2. Clone the repo by typing git clone git://github.com/dcgrigsby/TallyTrucks.git

No comments:

Post a Comment