title: UIActionSheet Button loading a new view
body: <p>I have been trying this one tonight for a while....  I have a UIActionSheet in its own controller.  I import the controller in the view I would like it to be displayed.  I can't figure out how to make a new view be shown when the user presses one of the buttons (you can see where I just send an alert right now).  Any ideas?</p>
  
  <pre><code>- (void)helpButtonPressedView {
      // open a dialog with two custom buttons
      UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:@""
                                                      delegate:self cancelButtonTitle:@"Cancel" destructiveButtonTitle:nil
                                                      otherButtonTitles:@"Help", @"Credits", nil];
      [self parentViewController];
      actionSheet.actionSheetStyle = UIActionSheetStyleDefault;
      [actionSheet showInView:self.view]; // show from our table view (pops up in the middle of the table)
      [actionSheet release];
  }
  
  - (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex {
      NSLog(@"Button Pressed: %d",buttonIndex);
  
      int btn = buttonIndex;
  
      UIAlertView *alert;
  
      switch (btn) {
          case 0:
              // help screen
              alert = [[UIAlertView alloc] initWithTitle:@"Button Press Notice" message:@"The Help screen will be dispayed"
                                                             delegate:self cancelButtonTitle:@"OK" otherButtonTitles: nil];
              [alert show];   
              [alert release];
  
  //          helpViewController = [[HelpViewController alloc] init]; 
  //          [self presentModalViewController:helpViewController animated:YES];
  
              break;
          case 1:
              // credits screen
              alert = [[UIAlertView alloc] initWithTitle:@"Button Press Notice" message:@"The Credits screen will be dispayed"
                                                delegate:self cancelButtonTitle:@"OK" otherButtonTitles: nil];
              [alert show];   
              [alert release];            
              break;
          default:
              break;
      }
  
  }
  </code></pre>
  
  <p>Here is a pic of what I am trying to do...  When the user presses on the "Help" button, a new view shows.  When the user presses the "Credits" button a different view shows.  I am using IB to create the views.</p>
  
  <h1><a href="http://thecoolestcompany.com/UIActionSheet-view.jpg" rel="nofollow noreferrer" title="UIActionSheet Options">alt text http://thecoolestcompany.com/UIActionSheet-view.jpg</a></h1>