Advertisement
Guest User

Untitled

a guest
May 30th, 2017
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. - (void)showGameOverDialog {
  2.     UIAlertView *alertView =
  3.         [[UIAlertView alloc] initWithTitle:@"No words left"
  4.                                    message:@""
  5.                                   delegate:self
  6.                          cancelButtonTitle:@"New game"
  7.                          otherButtonTitles:@"Previous game info",
  8.                                            @"Report bug",
  9.                                            NULL];
  10.     [alertView setTag:TAG_GAME_OVER];
  11.     [alertView show];  
  12.     [alertView release];
  13. }
  14.  
  15.  
  16. - (void)alertView:(UIAlertView *)alertView
  17. clickedButtonAtIndex:(NSInteger)buttonIndex {
  18.    NSString *buttonTitle = [alertView buttonTitleAtIndex:buttonIndex];
  19.    NSInteger tag = [alertView tag];
  20.    
  21.    if (tag == TAG_GAME_OVER) {
  22.       if (buttonIndex == [alertView cancelButtonIndex]) {
  23.          [self newGame];
  24.       } else if ([buttonTitle isEqualToString:@"Previous game info"]) {
  25.          [self previousGameInfo];
  26.       } else if ([buttonTitle isEqualToString:@"Report bug"]) {
  27.          [self reportBug];
  28.       }
  29.    }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement