title: Detecting button pressed when there are multiple alert views
body: <p>I have multiple alert views in one view, and I use this code to detect which button was pressed:</p>
  
  <pre><code>-(void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex {  
  
      NSString *title = [alertView buttonTitleAtIndex:buttonIndex];  
  
      if ([title isEqualToString:@"OK"]) {
  
            //for one alert view
            [passCode becomeFirstResponder];
  
       } else if ([title isEqualToString:@" OK "]) {
  
          //for another alert view, had to change "OK" to " OK "
          [passCodeConfirm becomeFirstResponder];
  
      }
  }   
  </code></pre>
  
  <p>Now since there are multiple alert views in one view that do different things, I have to trick the user into thinking "OK" and " OK " are the same thing. It works and looks fine, but it feels kind of messy. Surely there is another way to do this, such as making this specific to an alert view, and then making it specific to another. Do you know how I would do this? Thanks!</p>