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

  • Home
  • SEARCH
  • 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 6843825
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T00:17:57+00:00 2026-05-27T00:17:57+00:00

In my app I have a xib that has several viewcontrollers and xibs (with

  • 0

In my app I have a xib that has several viewcontrollers and xibs (with more viewcontrollers)off of it.

I can go from xib to xib and load what ever view controllers I want.

My problem is when I go to a view in side one off my viewcontrollers (be it on the main xib or another) I have a navigation bar at the bottom with a single button marked “back”. Now when this button is hit before it takes you back It asks if you want something to happen.

When you click yes a UIAlertView will pop up and tell you wants about to happen when you click “ok”. I know my button is firing by NSLogging my tag.

However I need a certain xib file to load and it does not.

This is the code that I am trying to use — now this works If I want to go from xib to xib from a button. So I am not sure why its not working in an alert view.

- (void)alertView:(UIAlertView *)alert clickedButtonAtIndex:(NSInteger)buttonIndex {
// the user clicked one of the OK/Cancel buttons
if(alert.tag==1)
{
    if (buttonIndex==0) {
        ControllPanelViewController *controllpanel = [[ControllPanelViewController alloc] initWithNibName:nil bundle:nil];
        [self presentModalViewController:controllpanel animated:YES];    
        NSLog(@"index 0");
    }
}

}
enter image description here

Adding pic do to a response:
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-05-27T00:17:57+00:00Added an answer on May 27, 2026 at 12:17 am

    I have had similar problems before, not with a UIViewController, but with a UIActionSheet. When I tried to do this, I wanted to present a UIActionSheet depending on the selection of the UIAlertView. When I pressed something in the UIAlertView, the view was dismissed, but my action sheet was not shown. This was my solution; instead of:

    if(alert.tag==1) {
        if (buttonIndex==0) {
            ControllPanelViewController *controllpanel = [[ControllPanelViewController alloc] initWithNibName:nil bundle:nil];
            [self presentModalViewController:controllpanel animated:YES];    
            NSLog(@"index 0");
        }
    }
    

    try something like:

    if(alert.tag==1)
        if (buttonIndex==0)
            [self performSelector:@selector(presentController) withObject:nil afterDelay:.1];
    

    with the method presentController being:

    ControllPanelViewController *controllpanel = [[ControllPanelViewController alloc] initWithNibName:nil bundle:nil];
    [self presentModalViewController:controllpanel animated:YES];    
    NSLog(@"index 0");
    

    The problem seems to be that the UIAlertView takes some time to dismiss itself (very small amount of time) and in that time presenting another view doesn’t work.

    Also, as Alan Zeino said, if the name of the xib is not the same as the name of the view controller (for example if you have two different xibs- one for ipad and one for iphone), then you do need to specify which to use. If the name of the xib is the same as the view controller, you do not have to specify a name.

    Edit:

    If you want to use an action sheet and expect the delegate methods to work when their actions are triggered, you’d better set the delegate of the action sheet to self and in your interface file add the protocol.

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

Sidebar

Related Questions

I have downloaded an Xcode project that has three xibs (A.xib, B.xib, and C.xib).
i have created a project which has different xib viewcontrollers.In first view am selecting
I have a little app that have by default youtube as homepage. You can
In my iPhone app I have a UIViewController that has a UITableView and another
I have a nib (winA.xib) that contains a window. My app delegate contains an
I am working on an app that has 12 localizations of about 16 XIBs.
I am working on an app that has several different views, two of the
Greetings! I have a working iPhone app (huzzah!) that uses a MainView.xib containing a
So I have a view that I have put together in another .xib file.
I have an app that is has been released and is in the app

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.