title: UIAlertView crashes when button tapped: how to solve?
body: <p>I have a class that I instance to show an alert view like this:</p>
  
  <pre><code>- (void)showAlert
  {       
    UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Do you want to try again?"
                                                          message:nil
                                                         delegate:self
                                                cancelButtonTitle:@"Yes"
                                                otherButtonTitles:@"No", nil];
  
    [alertView show];
  }
  </code></pre>
  
  <p>}</p>
  
  <p>I need <code>self</code> to be the delegate because I need <code>alertView:didDismissWithButtonIndex:</code> to be called to perform some actions when the user taps the alert view's button. This usually works well, but from time to time, I get this crash:</p>
  
  <pre><code>SIGSEGV
  UIKit-[UIAlertView(Private) modalItem:shouldDismissForButtonAtIndex:]
  </code></pre>
  
  <p>I guess this is because the delegate, for any reason, was released, right? Or is this because what was released was the alert view? How could I solve this? I need the alert view to have a delegate, and I've reading several related posts and I couldn't find an answer that fits my scenario.</p>
  
  <p>I'm testing in iOS 7.0, I don`t know if that could have to do with the issue.</p>
  
  <p>Thanks in advance</p>