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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T06:14:46+00:00 2026-05-28T06:14:46+00:00

I have an app with a standard UIView that contains a toolbar. I am

  • 0

I have an app with a standard UIView that contains a toolbar. I am able to tap a button on the toolbar to open a UIActionSheet and am able to display my text there with no issues. What I’d like to do is have the action sheet items display a different XIB from my project. I have everything set up both in the relevant header and implementation files as well as the XIBs, but I need to link the action of tapping the action sheet item to displaying the second view.

This is what I have so far:

- (void)actionSheet:(UIActionSheet *)sheet willDissmissWithButtonIndex:(NSInteger)buttonIndex {

    if (buttonIndex != [sheet cancelButtonIndex]) {

        if (buttonIndex == 0) {

            ABC *secondview = [[ABC alloc] initWithNibName:nil bundle:nil];
            [self presentModalViewController:secondview animated:YES];
        }

        if (buttonIndex == 1) {

            DEF *secondview = [[DEF alloc] initWithNibName:nil bundle:nil];
            [self presentModalViewController:secondview animated:YES];

        }

        if (buttonIndex == 2) {

            GHI *secondview = [[GHI alloc] initWithNibName:nil bundle:nil];
            [self presentModalViewController:secondview animated:YES];   

        }

    [self dismissModalViewControllerAnimated:YES];

    };

}

This opens my action sheet and displays all the correct info, but tapping “ABC,” “DEF,” or “GHI” only closes the action sheet as though I’ve tapped the cancel button. How do I set it so tapping “ABC,” “DEF,” or “GHI” opens a different XIB in my project?

  • 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-28T06:14:46+00:00Added an answer on May 28, 2026 at 6:14 am

    Start by fixing your method name: you have misspelled “dismiss”. If this is your actual code, the delegate method currently isn’t being called.

    Follow-up:

    OK, I tested your code (with or without the seemingly unnecessary dismissModalViewController…) and it works for me.

    Which makes me think that there is something wrong with your larger setup. Have you set a breakpoint and made sure your code is actually getting run?

    If it’s not getting run (which is my suspicion), check if you failed to pass the appropriate value for delegate: when you were setting up your UIActionSheet. (In particular, might you have passed nil as the delegate? This would cause a silent failure of the kind you are describing.)

    Are you getting any warnings from the compiler/Clang?

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

Sidebar

Related Questions

My app have a background image that fills the screen. I'd like to display
I have an app that I want to have a button that will show
I have a C++ app that uses standard socket calls and I want to
I have an app that is using standard out of the box form validation
I have an app that runs a process which needs to open an internet
I have an iPhone project that starts out with a standard UIView based Window...
I have an app that uses standard id integer autoincrement values. I also have
I have an App that does the pretty standard operation: It plays audio (streamed
I have a web app that has standard user model information. I am building
I have an app that replaces the standard incoming call screen with my own

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.