iphone UIActionSheet – pop up list of options
// place this code in a UIViewController subclass
- (void)debugButtonPressed:(id)sender
{
UIActionSheet* action = [[UIActionSheet alloc]
initWithTitle:@"Menu"
delegate:self
cancelButtonTitle:@"Continue"
destructiveButtonTitle:@"Quit"
otherButtonTitles:@"Debug",nil ];
[action showInView:self.view];
[action release];
}
- (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex {
switch (buttonIndex) {
case 0: // continue
NSLog(@"Continue");
break;
case 1: // Quit
NSLog(@"Quit");
break;
case 2: // Debug
NSLog(@"Debug");
break;
}
}
