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 8408453
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T23:38:09+00:00 2026-06-09T23:38:09+00:00

I have a universal app and have an action sheet with a few buttons.

  • 0

I have a universal app and have an action sheet with a few buttons. When I tap the add button (navigationItem.right) I want it to show in a popoever. It does this correctly, however, with the actionSheet tied to the barbutton item, it allows me to continually tap the add button and have more popup.

I thought tapping outside the popover would dismiss this…

- (IBAction)ShowItemAdd:(id)sender
{
    addActionSheet = [[UIActionSheet alloc] initWithTitle:nil delegate:self cancelButtonTitle:@"Cancel" destructiveButtonTitle:nil otherButtonTitles:[dataObj.preferences objectForKey:@"appts_name"], @"Reserve", nil];
    if ([[UIDevice currentDevice] isPad]) {
        [addActionSheet showFromBarButtonItem:[[self navigationItem] rightBarButtonItem] animated:YES];
    } else {
        [addActionSheet showInView:self.view];
    }
}

Why is this not auto dismissing if I have it bound to the barbutton item?

EDIT

Tapping anywhere in the navigationItem bar (blue bar) at the top will not close the actionSheet, however tapping outside of the nav controller, will dismiss the actionsheet.

enter image description here

  • 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-09T23:38:10+00:00Added an answer on June 9, 2026 at 11:38 pm

    In your method you should first check to see whether your actionsheet is already visible, and if it is, dismiss it instead of creating a new actionsheet.

    - (IBAction)ShowItemAdd:(id)sender
    {
        if ([addActionSheet isVisible]) {
    
            [addActionSheet dismissWithClickedButtonIndex:[addActionSheet cancelButtonIndex] animated:YES];
    
        } else {
    
            addActionSheet = [[UIActionSheet alloc] initWithTitle:nil delegate:self cancelButtonTitle:@"Cancel" destructiveButtonTitle:nil otherButtonTitles:[dataObj.preferences objectForKey:@"appts_name"], @"Reserve", nil];
            if ([[UIDevice currentDevice] isPad]) {
                [addActionSheet showFromBarButtonItem:[[self navigationItem] rightBarButtonItem] animated:YES];
            } else {
                [addActionSheet showInView:self.view];
            }
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In a universal app, you have to add 6 splash images named Default.png. 320
I have a universal iOS app with a custom view that has three buttons,
I have created a universal app and I want to display a default image.
I have a universal app that displays buttons inside an actionsheet. UIActionSheet *actionSheet =
I am developing a Universal app where I have imageTracker_iPhone.xib imageTracker_iPad.xib imageTracker.h imageTracker.m I
I have finished developing a big and heavy app. It is universal (for iPhone
I have a universal app, where I am sharing the same controller for a
I have a Universal app which is targeting 10.5 and which uses garbage collection.
I have a universal app. On the iPad, when pressing an annotation pin it
My situation is that I have a universal app that talks to an sql

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.