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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T12:29:35+00:00 2026-05-25T12:29:35+00:00

For the navigation in my app I’m using a UITabBarController. This works fine, but

  • 0

For the navigation in my app I’m using a UITabBarController. This works fine, but in one of my viewcontrollers I want to push another view controller into the tabbar view.
In other words I want to replace the selected viewcontroller with another one.
I’m doing this with the following code:

self.tabBarController.selectedViewController = self.otherViewController;

The list of viewControllers in my TabBarController does not contain the otherViewController.
This trick works fine in IOS 4.3, but IOS 5 does not like it.

Does anyone know a solution which is accepted by IOS 5?

  • 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-25T12:29:35+00:00Added an answer on May 25, 2026 at 12:29 pm

    You want to REPLACE that view controller in the tabbar with another view Controller?
    If so, you have to edit the viewControllers property in the tabbar by setting a new one. It would be something like:

    UIViewController *thisIsTheViewControllerIWantToSetNow;
    int indexForViewControllerYouWantToReplace;
    
    NSMutableArray *tabbarViewControllers = [self.tabbar.viewControllers mutableCopy];
    
    [tabbarViewControllers replaceObjectAtIndex:indexForViewControllerYouWantToReplace withObject:thisIsTheViewControllerIWantToSetNow];
    
    self.tabbar.viewControllers = tabbarViewControllers;
    
    [tabbarViewControllers release];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i am using navigation based app. i am using push pop for switching view.
I'm building a WPF app using pages and the navigation service. One of the
In Navigation-based App, when i try to load another view which has got implemented
I have a Navigation Controller app and I'm using this code to switch views:
I load a UIWebView from a string in a navigation based app. I'm using
I'm using a navigation controller for my app, because a lot of my views
I added a navigation control to switch between views in my app. But some
I'm building a WPF navigation app, with pages. I want to ask the user
I have a navigation based app where I push UITableViewControllers onto the stack. I
I've built a Navigation-based app, but now that I'm knee-deep in the code, I've

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.