title: Xcode Buttons: Some work, some do not?
body: <p>I am attempting to design an app for my senior project, and am thus fairly new to iOS coding. I have created a .xib view controller, and added a number of buttons to it, over top of some card images. There is one large button over the other player's hand, and sever smaller ones over each of the player's own cards.</p>
  
  <p>I have added UIAlertControllers to each button, intending the pop-ups to allow the player to play or discard their own cards, or send some information about the other player's.</p>
  
  <p>The Alert pops up fine for the other player's button, but the ones for the bottom cards do absolutely nothing. I have checked that they are all connected to the IBActions, and the code is nearly identical to the button that IS working. Any ideas?</p>
  
  <p>This is all contained within <code>gameViewController.m:</code> <code>btnTop</code> correctly performs its action, while <code>btnBottom1</code> - <code>btnBottom5</code> do nothing.</p>
  
  <pre><code>- (IBAction)btnTop:(id)sender{
      NSLog(@"Top Button Pressed. Displaying AlertView.");
      UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"Give Information" message:@"Would you like to give information about color or number?" preferredStyle:UIAlertControllerStyleAlert];
      UIAlertAction *actionColor = [UIAlertAction actionWithTitle:@"Color" style:UIAlertActionStyleDefault
                                                          handler:^(UIAlertAction *action)
                                    {
                                        [self giveColorInfo];
                                    }];
      UIAlertAction *actionNumber = [UIAlertAction actionWithTitle:@"Number" style:UIAlertActionStyleDefault handler:nil];
      UIAlertAction *actionCancel = [UIAlertAction actionWithTitle:@"Cancel" style:UIAlertActionStyleDefault handler:nil];
      [alertController addAction:actionColor];
      [alertController addAction:actionNumber];
      [alertController addAction:actionCancel];
      [self presentViewController:alertController animated:YES completion:nil];
  
  }
  
  - (IBAction)btnBottom1:(id)sender{
      NSLog(@"Bottom 1 Button Pressed. Displaying AlertController.");
      UIAlertController *alertController2 = [UIAlertController alertControllerWithTitle:@"Play or Discard Card 1" message:@"Would you like to play or discard?" preferredStyle:UIAlertControllerStyleAlert];
      UIAlertAction *actionPlay = [UIAlertAction actionWithTitle:@"Play" 
                                                           style:UIAlertActionStyleDefault
                                                         handler:^(UIAlertAction *action)
                               {
                                   [self playCard:1];
                               }];
  
      UIAlertAction *actionDiscard = [UIAlertAction actionWithTitle:@"Discard" style:UIAlertActionStyleDefault handler:nil];
      UIAlertAction *actionCancel = [UIAlertAction actionWithTitle:@"Cancel" style:UIAlertActionStyleDefault handler:nil];
      [alertController2 addAction:actionPlay];
      [alertController2 addAction:actionDiscard];
      [alertController2 addAction:actionCancel];
      [self presentViewController:alertController2 animated:YES completion:nil];
  }
  
  - (IBAction)btnBottom2:(id)sender {
      NSLog(@"Bottom 2 Button Pressed. Displaying AlertView.");
      UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"Play or Discard Card 2" message:@"Would you like to play or discard?" preferredStyle:UIAlertControllerStyleAlert];
      UIAlertAction *actionPlay = [UIAlertAction actionWithTitle:@"Play" 
                                                           style:UIAlertActionStyleDefault
                                                         handler:^(UIAlertAction *action)
                               {
                                   [self playCard:2];
                               }];
      UIAlertAction *actionDiscard = [UIAlertAction actionWithTitle:@"Discard" style:UIAlertActionStyleDefault handler:nil];
      UIAlertAction *actionCancel = [UIAlertAction actionWithTitle:@"Cancel" style:UIAlertActionStyleDefault handler:nil];
      [alertController addAction:actionPlay];
      [alertController addAction:actionDiscard];
      [alertController addAction:actionCancel];
      [self presentViewController:alertController animated:YES completion:nil];
  }
  
  - (IBAction)btnBottom3:(id)sender {
      NSLog(@"Bottom 3 Button Pressed. Displaying AlertView.");
      UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"Play or Discard Card 3" message:@"Would you like to play or discard?" preferredStyle:UIAlertControllerStyleAlert];
      UIAlertAction *actionPlay = [UIAlertAction actionWithTitle:@"Play"  
                                                           style:UIAlertActionStyleDefault
                                                         handler:^(UIAlertAction *action)
                               {
                                   [self playCard:3];
                               }];
      UIAlertAction *actionDiscard = [UIAlertAction actionWithTitle:@"Discard" style:UIAlertActionStyleDefault handler:nil];
      UIAlertAction *actionCancel = [UIAlertAction actionWithTitle:@"Cancel" style:UIAlertActionStyleDefault handler:nil];
      [alertController addAction:actionPlay];
      [alertController addAction:actionDiscard];
      [alertController addAction:actionCancel];
      [self presentViewController:alertController animated:YES completion:nil];
  }
  
  - (IBAction)btnBottom4:(id)sender {
      NSLog(@"Bottom 4 Button Pressed. Displaying AlertView.");
      UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"Play or Discard Card 4" message:@"Would you like to play or discard?" preferredStyle:UIAlertControllerStyleAlert];
      UIAlertAction *actionPlay = [UIAlertAction actionWithTitle:@"Play"  
                                                           style:UIAlertActionStyleDefault
                                                         handler:^(UIAlertAction *action)
                               {
                                   [self playCard:4];
                               }];
      UIAlertAction *actionDiscard = [UIAlertAction actionWithTitle:@"Discard" style:UIAlertActionStyleDefault handler:nil];
      UIAlertAction *actionCancel = [UIAlertAction actionWithTitle:@"Cancel" style:UIAlertActionStyleDefault handler:nil];
      [alertController addAction:actionPlay];
      [alertController addAction:actionDiscard];
      [alertController addAction:actionCancel];
      [self presentViewController:alertController animated:YES completion:nil];
  }
  
  - (IBAction)btnBottom5:(id)sender {
      NSLog(@"Bottom 5 Button Pressed. Displaying AlertView.");
      UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"Play or Discard Card 5" message:@"Would you like to play or discard?" preferredStyle:UIAlertControllerStyleAlert];
      UIAlertAction *actionPlay = [UIAlertAction actionWithTitle:@"Play"  
                                                           style:UIAlertActionStyleDefault
                                                         handler:^(UIAlertAction *action)
                               {
                                   [self playCard:5];
                               }];
      UIAlertAction *actionDiscard = [UIAlertAction actionWithTitle:@"Discard" style:UIAlertActionStyleDefault handler:nil];
      UIAlertAction *actionCancel = [UIAlertAction actionWithTitle:@"Cancel" style:UIAlertActionStyleDefault handler:nil];
      [alertController addAction:actionPlay];
      [alertController addAction:actionDiscard];
      [alertController addAction:actionCancel];
      [self presentViewController:alertController animated:YES completion:nil];
  }
  </code></pre>