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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T14:25:45+00:00 2026-06-08T14:25:45+00:00

Ok, so with iOS 5 Apple introduced view controller containers (awesome!) Above is what

  • 0

enter image description here

Ok, so with iOS 5 Apple introduced view controller containers (awesome!)

Above is what the layer of my app looks like. TabBar contains NavController contains ViewController (container) which holds 2 table views, toggled by a segmented control.

When I pick a table cell, it pushes the new view easily. However, if I press a button within the detailViewController, i want it to modally show MFMailComposeViewController. Which presents itself briefly, then instantly dismisses itself. The error log I get is:

Unbalanced calls to begin/end appearance transitions for UITabBarController

Now, this means im trying to present a view while the other is still showing or in runtime loop, ive tried adding delays to stop this, but nothing works. Ive added all my delegates, and imported all my libraries correctly.

I think it may have something to do with how i push new views from the original tableview or how I load views into the container. The project uses the base code for Xcode’s Tab Bar app template, just so you know. Here’s the code:

ViewController / Container

- (void)viewDidLoad
{
    [super viewDidLoad];

    // Alloc Init View Controllers
    menuDrinksViewController = [[MenuDrinksViewController alloc] init];
    menuFoodViewController = [[MenuFoodViewController alloc] init];

    // Create Parent/Child relationship
    [menuFoodViewController didMoveToParentViewController:self];
    [self addChildViewController:menuFoodViewController];

    [menuDrinksViewController didMoveToParentViewController:self];
    [self addChildViewController:menuDrinksViewController];

    [appearanceClass setBackgroundImage:self.view];

    // segmented controller
    segmentedControl = [[SVSegmentedControl alloc] initWithSectionTitles:[NSArray arrayWithObjects:@"              Eat              ", @"               Drink               ", nil]];
    [segmentedControl addTarget:self action:@selector(segmentAction:) forControlEvents:UIControlEventValueChanged];
    [appearanceClass setSegmentedControl:segmentedControl];
    [self.view addSubview:segmentedControl];

    //self.view.backgroundColor = [UIColor redColor];

    // Add and Size subviews
    [self.view addSubview:menuFoodViewController.view];
    menuFoodViewController.view.frame = CGRectMake(0, 39, 320, self.view.frame.size.height - 40 + 1);
    menuDrinksViewController.view.frame = CGRectMake(0, 39, 320, 327 + 1);
}


-(IBAction)segmentAction:(id)selector
{
    // it's a custom segmented control, dw bout the code.
    if (segmentedControl.selectedIndex == 0)
    {
        [self.view addSubview:menuFoodViewController.view];
        [menuDrinksViewController.view removeFromSuperview];
    }
    else if (segmentedControl.selectedIndex == 1)
    {
        [self.view addSubview:menuDrinksViewController.view];
        [menuFoodViewController.view removeFromSuperview];
    }

}

TableViewController

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    MenuFoodDetailViewController *menuFoodDetailViewController = [[MenuFoodDetailViewController alloc] initWithNibName:nil bundle:nil];
    //MenuFoodDetailViewController *menuFoodDetailViewController = [[MenuFoodDetailViewController alloc] init];

    [self.parentViewController.navigationController pushViewController:menuFoodDetailViewController animated:YES];
    [tableView deselectRowAtIndexPath:indexPath animated:NO];
}

ButtonPress Code from detail view controller.

- (void)showMailComposer
{
    // attempt to delay the presentModalView call, doesnt work...
    double delayInSeconds = 0.1;
    dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, delayInSeconds * NSEC_PER_SEC);
    dispatch_after(popTime, dispatch_get_main_queue(), ^(void){
        [self.navigationController presentModalViewController:mailComposeViewController animated:YES];
    });
}

I know this is a lot to ask, but ive been at this for days.
All code not associated with views, i.e. MFMailViewComposer works fine, I’ve tested it in other apps.

I’ve tried all sorts of variations to push the new modal view, i.e.
self.parentViewController.navigationController presentModal... (etc)

Nothing is working =/

  • 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-08T14:25:46+00:00Added an answer on June 8, 2026 at 2:25 pm

    turns out it was a bug within iOS5. After recreating the code on a seperate project, it worked. So i traced the problem to the iOS5 Appearance Customization protocols, when i tried changing the font within UINavigationBar, it causes errors within MFMailComposeViewController and another modal view within iOS6.

    I have filed a radar with Apple

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

Sidebar

Related Questions

I've got an iOS app that links to 15 Apple frameworks (including the ~3
I'm running through the Your Second iOS App tutorial on Apple, and I'm on
as I am following the second of Apple's beginner-tutorials Your second iOS App, it
We found that your app does not comply with the Apple iOS Human Interface
Apple introduced a new decimal pad keyboard type in iOS 4.1 (I think). I'd
Apple describes iOS SDK 4 contains over 1,500 new APIs. Such as 1.Calendar Access
I'm writing an Apple iOS app that login to a account and fetching some
I'm about to submit my apple iOS app for the first time, and have
Quick question for anyone who is well informed on how the Apple iOS App
All I made a game for the Apple iOS. Now I would like to

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.