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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T01:28:28+00:00 2026-05-24T01:28:28+00:00

I have a UINavigationController(a) that pushes a UIViewController(b) onto the stack. (b) contains a

  • 0

I have a UINavigationController(a) that pushes a UIViewController(b) onto the stack. (b) contains a UITabBarController(c). (c) has 5 tabs and any of these ViewControllers(d,e,f,g,h) needs to be able to pop (b) off the stack.

I’ve tried [[self.parentViewController navigationController] popViewControllerAnimated:YES]; among many other things, none of which seem to work. Any ideas?

Edit:

.h file:

@interface MATabViewController : UIViewController<UITabBarControllerDelegate> {
UIViewController *ref;
}

@property (nonatomic, retain) IBOutlet UITabBarController *tabBarController;
@property (nonatomic, retain) IBOutlet UIImageView *imgViewFooter;

@end

.m:

#import "MATabViewController.h"

@implementation MATabViewController
@synthesize tabBarController = _tabBarController;
@synthesize imgViewFooter;

- (void)viewDidLoad
{
[super viewDidLoad];

self.view = self.tabBarController.view;

self.tabBarController.delegate = self;
self.imgViewFooter.frame = CGRectMake(0.0f, 395.0f, 320.0f, 64.0f);
[self.tabBarController.view addSubview:self.imgViewFooter];
self.tabBarController.selectedIndex = 0;

ref = [[self.tabBarController viewControllers] objectAtIndex:0];
}

-(BOOL)tabBarController:(UITabBarController *)tabBarController shouldSelectViewController:(UIViewController *)viewController {

NSInteger index = [[tabBarController viewControllers] indexOfObject:viewController];

switch (index) {
    case 0:
        self.imgViewFooter.image=[UIImage imageNamed:@"footer_full.png"];
        break;
    case 1:
        self.imgViewFooter.image=[UIImage imageNamed:@"footer_full.png"];
        break;
    case 2:
        self.imgViewFooter.image=[UIImage imageNamed:@"footer_full.png"];
        break;
    case 3:
        self.imgViewFooter.image=[UIImage imageNamed:@"footer_full.png"];
        break;
    case 4:
        self.imgViewFooter.image=[UIImage imageNamed:@"footer_full.png"];
        break;

    default:
        break;
}
return YES;
}

-(void)tabBarController:(UITabBarController *)tabBarController didSelectViewController:(UIViewController *)viewController {
if (ref != viewController) {
    [ref viewDidDisappear:YES];
    ref = viewController;
    [viewController viewDidAppear:YES];
}
}

@end

notice how I have a major hack in this line:

self.view = self.tabBarController.view;
  • 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-24T01:28:29+00:00Added an answer on May 24, 2026 at 1:28 am

    I experienced a similar problem (if I get the question). May you declare your UIViewController (b) as a subclass of UITabBarController? Notice that UITabBarController is a subclass of UIViewController, so you can keep using it as a normal UIViewController. This way you’ll have (b) and (c) in a single controller.
    Now [self.navigationController popViewController]; should work.
    At least, that’s the way I solved it.

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

Sidebar

Related Questions

I have an app that has a UINavigationController that pushes a UITabBarController into view.
I have UINavigation Controller that has a UIViewController pushed onto the stack and displayed.
HEllo, I have a hybrid iPhone application that has a UITabBarController and 5 Tabs.
I have a UINavigationController with two UITableViewControllers pushed onto its stack. Is there any
I have a UIViewController that is pushed onto a UINavigationController and is currently displayed.
I have a UINavigationController that contains 3 UIViewControllers on the stack. View A -
So I have a UINavigationController that pushes a UITableViewController from the rootViewController. From the
I have a UINavigationController that has a UIToolbar on the bottom. Several of my
I have a UINavigationController onto which I push a 'loading screen' UIViewController whilst I
I currently have a UINavigationController based application that works just fine. I'd 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.