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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T20:10:29+00:00 2026-05-18T20:10:29+00:00

I have a question regarding the UIActionSheet on the iPad. When I present an

  • 0

I have a question regarding the UIActionSheet on the iPad.

When I present an action sheet from presentFromBarButtonItem:animated: and present another one after that (by tapping on another UIBarButtonItem on the same UIToolbar), the original UIActionSheet stays open.

It doesn’t look particularly good.

I’ve tried iterating through self.view.subviews and casting the view to a UIActionSheet and calling its appropriate dismissWithClickedButtonIndex:animated: method, however it doesn’t work.

For example:

- (void)pressBarButtonItem {
    for (UIView *view in self.view.subviews) {
        [(UIActionSheet *)view dismissWithClickedButtonIndex:-1 animated:YES];
    }
}

Any help appreciated.

  • 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-05-18T20:10:29+00:00Added an answer on May 18, 2026 at 8:10 pm

    I think you mean showFromBarButtonItem:animated: instead of presentFromBarButtonItem:animated:?

    The action sheet doesn’t dismiss automatically on the iPad when you tap on another toolbar item because the toolbar is added to the action sheet’s list of passthrough views.

    Keep a reference to the action sheet in a property. After calling showFromBarButtonItem, save it in the property using self.itemFooActionSheet = actionSheet;.

    Before showing another action sheet from another item, call dismissWithClickedButtonIndex on itemFooActionSheet. After dismissing it, you may also want to release itemFooActionSheet and set it to nil so it doesn’t hang around in memory.

    Additionally, it’s possible that the code will try to show item Foo’s action sheet again while it’s already displayed. In the method where you show item Foo’s action sheet, first check if self.itemFooActionSheet is not nil and if so, just show it without re-creating it or dismiss+destroy the current action sheet and build a new one (the old one might contain outdated information).

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

Sidebar

Related Questions

I have a question regarding the UIActionSheet on the iPad. When I present an
Following on from my recent question regarding parsing XML files in Java I have
I have a question about best practices regarding how one should approach storing complex
I would have question regarding web services. Let's say I have webservice client that
I have question regarding the CreateWindowEx function. I have 2 windows, a main one
I have a question regarding the binding I have two textbox, textbox one is
I have question regarding about finding subview using '.tags' in one UIView. for (UIView
I have a question regarding development for Ipad. Is there an advantage to develop
I have a question regarding the two additional columns (timeCreated, timeLastUpdated) for each record
I have a question regarding an update function I created... CREATE OR REPLACE FUNCTION

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.