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 a UINavigationController containing an UIViewController initialized with a UIView. The UINavigationController also
I have an application with 5 UIViewController s each inside a corresponding UINavigationController ,
I have a UINavigationController. In its toolbar is a segmented control with two buttons.
I'm working on a simple iPhone app. I have 1 UINavigationController and 2 subclasses
Have you ever seen any of there error messages? -- SQL Server 2000 Could
Have you guys had any experiences (positive or negative) by placing your source code/solution
I have an issue issue with the UINavigationController on the iPad. When the app
I have a UIViewController which uses the UITableViewDelegate and UITableViewDataSource. I have created UITableView
Have just started using Google Chrome , and noticed in parts of our site,
Have just started using Visual Studio Professional's built-in unit testing features, which as I

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.