I am trying to use a UIAction sheet to confirm a user’s action. The log prints fine... but the app hangs and shows the lightened circle in the middle like when you do a UIAlert view. I’m sure its something simple... but can’t seem to find it.
-(IBAction)showActionSheet:(id)sender
{
UIActionSheet *popupQuery = [[UIActionSheet alloc] initWithTitle:@"Are you sure?" delegate:self cancelButtonTitle:@"Cancel Button" destructiveButtonTitle:@"Reset Player" otherButtonTitles:nil];
popupQuery.actionSheetStyle = UIActionSheetStyleBlackOpaque;
[popupQuery showInView:self.view];
}
-(void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex {
if (buttonIndex == 0) {
NSLog(@"Destructive Button Clicked");
}
else if (buttonIndex == 1) {
NSLog(@"Cancel Clicked");
}
Implement this handler instead of clickedButtonAtIndex
:
- (void)actionSheet:(UIActionSheet *)actionSheet didDismissWithButtonIndex:(NSInteger)buttonIndex