changing storyboard after UIAlert button pressed <p>I want to change to the main menu after clicking main menu at the game over UIAlert</p> <p>trying this:</p> <pre><code> -(void)gameOver { UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Time's up!" message:[NSString stringWithFormat:@"You've scored: %i points!", scoreCounter] delegate:self cancelButtonTitle:nil otherButtonTitles:@"Submit to Leaderboards",@"Play Again",@"Main Menu", nil]; [alert show]; } -(void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex { if (buttonIndex == 1) { [self toMain]; } if (buttonIndex == 2) { [self toMain]; } if (buttonIndex == 3) { [self toMain]; } } -(void)toMain { mainMenu *main = [[mainMenu alloc] initWithNibName:nil bundle:nil]; [self presentViewController:main animated:YES completion:NULL]; } </code></pre> <p>does nothing at all...</p> <p>EDIT</p> <p>fixed the button index, now facing a black screen after [self toMain]</p>