title: Elegant solution for UIActionSheet mess
body: <p>I am trying to find an elegant solution to UIActionSheet problem.</p>
  
  <p>I use UIActionSheets like this:</p>
  
  <pre><code>UIActionSheet * myChoices = [[UIActionSheet alloc]
      initWithTitle:nil
      delegate:self
      cancelButtonTitle:@"cancel"
      destructiveButtonTitle:@"erase"
      otherButtonTitles: @"aaa", @"bbb", @"ccc", @"ddd", nil]; 
  </code></pre>
  
  <p>the problem is that in order to discover the option selected by the user, I have to use this:</p>
  
  <pre><code>- (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex {
  
      switch ([actionSheet tag]) {
             case 0: ... 
             case 1: ... 
             case 2: ... 
             case 3: ... 
  
          }
  }
  </code></pre>
  
  <p>this case based on index is terrible, because if I change the order of the aaa, bbb, ccc, etc., on the action sheet I have to change the case order. This index stuff is not good as a solid solution.</p>
  
  <p>I have tried to imagine a way to do that and become index independent but did not come any satisfactory solution. Using buttonTitleAtIndex is not good enough too, because my apps are localized and I would have to test for n titles for every entry. Any suggestions?</p>