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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T19:07:08+00:00 2026-05-24T19:07:08+00:00

I have a view with a tab bar and a table view in it.

  • 0

I have a view with a tab bar and a table view in it. At a certain point I call a modal view, and when I dismiss it, the original view seems to stretch or shift down, as the background image is lower and the table view is longer to the point that the last cell goes outside of the frame.

I call the modal view from tableView:didSelectRowAtIndexPath:

- (void) tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    NSMutableDictionary *row        = [[[[self.productDetails valueForKey:@"sections"] objectAtIndex:indexPath.section] valueForKey:@"rows"] objectAtIndex:indexPath.row];
    NSMutableDictionary *post       = [self.productDetails valueForKey:@"post"];
    if ([[row valueForKey:@"type"] isEqualToString:@"pick"])
    {
        self.xPicker                = nil;
        self.xPicker.options        = nil;
        self.pickerOptions          = nil;
        self.xPicker                = [[[TablePicker alloc] initWithNibName:@"TablePicker" bundle:[NSBundle mainBundle]] autorelease];
        NSMutableDictionary *newPicker  = [[[NSMutableDictionary alloc] init] autorelease];
        [newPicker setValue:[NSString stringWithFormat:@"%d", indexPath.section] forKey:@"section"];
        [newPicker setValue:[NSString stringWithFormat:@"%d", indexPath.row] forKey:@"row"];
        [newPicker setValue:[row valueForKey:@"options"] forKey:@"options"];
        [newPicker setValue:[row valueForKey:@"value"] forKey:@"value"];
        self.xPicker.options        = [NSMutableDictionary dictionaryWithDictionary:newPicker];
        self.pickerOptions          = [NSDictionary dictionaryWithDictionary:newPicker];
        self.xPicker.view.frame     = self.view.bounds;
        [self presentModalViewController:self.xPicker animated:YES];
    }
}

Inside the modal view controller, I do some stuff, then fire a notification to let the parent controller know that it’s ok to dismiss it. This part doesn’t feel right, but I was getting an error occassionally when I had the modal view call:

[self.parentViewController dismissModalViewControllerAnimated:YES];

Anyways, the code block where I dismiss the modal view is as follows:

- (void) reloadCell
{
    [self dismissModalViewControllerAnimated:YES];
    if (self.xPicker.choice != nil)
    {
        NSDictionary *choice        = self.xPicker.choice;
        NSMutableDictionary *row    = [[[[self.productDetails valueForKey:@"sections"] objectAtIndex:[[choice valueForKey:@"section"] intValue]] valueForKey:@"rows"] objectAtIndex:[[choice valueForKey:@"row"] intValue]];
        [row setObject:[choice valueForKey:@"value"] forKey:@"value"];
        [[self.productDetails valueForKey:@"post"] setObject:[choice valueForKey:@"value"] forKey:[row valueForKey:@"key"]];
        Request *xReq               = [[[Request alloc] init] autorelease];
        [NSThread detachNewThreadSelector:@selector(updateOrderFromProductDetails:) toTarget:xReq withObject:[self.productDetails valueForKey:@"post"]];
        self.xPicker                = nil;
    }
}

I don’t know if it’s related, but I found it interesting that when I present this modal controller while the device is in landscape mode, the view goes wonky.

Does anyone know how to fix this?

Edit: After some searching, it appears that both problems are related and have to do with my current view controller being a subview of another view controller, but not through a navigation controller.

As I understand it, my decision to not use a nav controller is confusing my view stack somehow. I had a feeling that would come back to bite me in the butt.

Unfortunately, I can’t seem to find a solution to my problem anywhere.

  • 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-24T19:07:09+00:00Added an answer on May 24, 2026 at 7:07 pm

    Ok, I have one solution to this problem.

    Instead of having my current view controller call presentModalViewController, I call it from the appDelegate tabBarController like so:

    [[(myAppDelegate *)[[UIApplication sharedApplication] delegate] tabBarController] presentModalViewController:self.myModalViewController animated:YES];
    

    This still feels a bit hacky, but it solves both problems of

    1) resizing when the modal view is dismissed

    2) the modal view being unable to pop up in landscape mode

    I hope this can help someone else out there in this cruel Apple world.

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

Sidebar

Related Questions

I have a Tab Bar with a navigation table view. My app crashes when
I have written the code programmatically for my tab bar in my table view.The
I have a table view in an iPhone xcode tab bar application that shows
I have root view with both tab bar and navigation bar visible at the
My problem is that I want to have a tab bar view with its
I have one tab bar app. In a specific tab, I use a table
I have a table based app and would like to add a tab bar
I have 3 view controller in a tab bar controller. Clicking on any tab
I have a tab view that loads a table view for each of the
hey guys, I created a Table View with Navigation Controller, in a Tab Bar

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.