Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7942167
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T23:53:11+00:00 2026-06-03T23:53:11+00:00

UIActionSheet, how to dismiss it with a single click? I have to click a

  • 0

UIActionSheet, how to dismiss it with a single click?
I have to click a button 2 times so it gets dismissed, what should I do to make it dismissble after the first click?! Here is my code:

-(void)buttonHeld:(id)sender
{



    UIActionSheet *popupQuery = [[UIActionSheet alloc] initWithTitle:@"Delete Contact?!" delegate:self cancelButtonTitle:@"Cancel" destructiveButtonTitle:@"Delete" otherButtonTitles: nil];

    popupQuery.actionSheetStyle = UIActionSheetStyleBlackOpaque;
    [popupQuery showInView:self.view];
    [popupQuery release];




}
-(void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex {


  if (buttonIndex == 0) {

 NSLog(@"Delete button clicked Button Clicked");


    else if (buttonIndex == 1) {

   NSLog(@"Cancel Button Clicked");
   } 

}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T23:53:12+00:00Added an answer on June 3, 2026 at 11:53 pm

    It took me a few taps to get it to cancel as well. The problem ended up being which view I attached it to.

    [action showInView:self.view];
    

    self.view was only referenced in IB. I changed it to a different view and it worked.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have a uiactionsheet and the buttom button doesnt work correctly the first time
I have an UIActionSheet and I am specifying the cancel button however it does
I have a UIActionSheet that pops up as soon as the initial view in
I have this code: UIActionSheet *actionSheet = [[[UIActionSheet alloc] initWithTitle:@Illustrations delegate:self cancelButtonTitle:@Cancel destructiveButtonTitle:nil otherButtonTitles:
I have a UIActionSheet as follows: UIActionSheet *sheet = [[UIActionSheet alloc] initWithTitle:[NSString stringWithFormat: @Cancel
I have a UIActionSheet which has options to choose image from Camera or photo
how can i use a particular UIActionSheet's button with some actioning (explain in brief)
I have a UIActionSheet which I create with the following code. UIActionSheet *popupQuery2 =
I have a UIActionSheet in my app that defaults to having 4 buttons. If
Currently I have a UIActionSheet in View B. I have the UIActionSheet launched in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.