Advertisement
Guest User

Untitled

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