title: Help with NSUndoManager
body: <p>Ok, So i want to add the ability to undo certain actions in my app.  I was going to create a way to do it, with my own protocals or something, but then I found out about <code>NSUndoManager</code>.  I would like to use the built in foundation way, but I can't seem to figure it out.  I need to undo multiple dice rolling, so if I could store the previous rolls, as objects in an <code>NSArray</code>, would probably be the best.  I could use an <code>NSMutableString</code>, but the array would be preferred.</p>
  
  <p>Then I know you can shake to undo, but I would rather have a button.  These has been giving me  the most trouble.  I've included my attempts below.  None of those have worked.  Any help would be appreciated.</p>
  
  <p>In viewDidLoad:</p>
  
  <pre><code>undoManager = [[NSUndoManager alloc] init];
  </code></pre>
  
  <p>Then in the method that rolls the dice, I tried:</p>
  
  <pre><code>   [[undoManager prepareWithInvocationTarget:self] undoButton];
      [[undoManager prepareWithInvocationTarget:self] 
      [[undoManager prepareWithInvocationTarget:self] setString:[NSString stringWithFormat:@"%i", dice1num]];
  
  setStrings:[NSArray arrayWithObjects:[NSString stringWithFormat:@"%i", dice1num]
      [NSString stringWithFormat:@"%i", dice1num],
      [NSString stringWithFormat:@"%i", dice1num],
      [NSString stringWithFormat:@"%i", dice1num],
      [NSString stringWithFormat:@"%i", dice1num], nil]];
  [[undoManager prepareWithInvocationTarget:@selector()];
  [undoManager setActionName:@"A roll"];
  </code></pre>
  
  <p>And then here is the IBAction that links to the undo button:</p>
  
  <pre><code>-(IBAction)undoButton{
             [undoManager undo];
  }
  </code></pre>
  
  <p>Thanks in advance</p>