title: Segue after pressing a button in UIAlertView
body: <p>I'm developing an app in which I need to show a <code>ViewController</code> when I press the "OK" button in an <code>UIAlertView</code>. How I can do that?</p>
  
  <p>I found on here this solution: <a href="https://stackoverflow.com/questions/11957433/ios-dev-segue-by-pressing-a-button-in-an-alert">iOS Dev: Segue by pressing a button in an Alert?</a>, but it didn't work. </p>
  
  <p>xCode says:</p>
  
  <pre><code>the method: presentModalViewController is deprecated
  </code></pre>
  
  <p>and I found on the web that I should use the method <code>presentViewController</code>.</p>
  
  <p>I tried to do that but it shows me a black screen without any interaction, what's wrong?
  I paste here my code, maybe you can help me.</p>
  
  <pre><code>-(void) alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
  {
      if (buttonIndex != alertView.cancelButtonIndex)
      {
          PromoViewController *pvc = [[PromoViewController alloc] init];
          [self presentViewController:pvc animated:YES completion:nil];
      }
  }
  </code></pre>
  
  <p>Thank you</p>