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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T08:19:47+00:00 2026-06-06T08:19:47+00:00

I am using popToViewController method to pop to a view controller. What I was

  • 0

I am using popToViewController method to pop to a view controller. What I was trying to achieve is to pop to an UITabBarController’s specific index.

NSArray *viewArrays = [self.navigationController viewControllers];

So my view hierarchy is;

<LoginViewController: 0x6b75850>,
<UITabBarController: 0x6ba0b50>,
<RequestViewController: 0x684fe90>,
<ApplyViewController: 0x6845790>

Following code does pops to my UITabBarController, but since I was on the third view of my UITabBarController, it pops back to the third view

[[self navigationController] popToViewController:[self.navigationController.viewControllers objectAtIndex:1]  animated:YES];

What I want is to pop to the second view of my UITabBarController.

Edit (Answer)

As stated, we don’t push or pop. So in order to gather your tabBarController you either use;

UITabBarController *myTabController = [self.navigationController.viewControllers objectAtIndex:indexOfYourTabBarControllerInYourNavigationController];
myTabController.selectedIndex = indexToGo;

or if you are on one of your tabBarController views;

self.tabBarController.selectedIndex = indexToGo;
  • 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-06T08:19:51+00:00Added an answer on June 6, 2026 at 8:19 am

    In UITabBarController you dont pop and push, if you want to go to the second view you would set the selected index instead

    Like so

    yourTabController.selectedIndex = 1;
    

    Or if the current view controller is a part of the tabBarController do

    self.tabBarController.selectedIndex = 1;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using UINavigationController to push and pop a view. I used [[self navigationController]
Consider: [self.navigationController popToViewController:[[self.navigationController viewControllers]objectAtIndex:1] animated:YES]; Is there a better way to get index of
I'm using a TTLauncherView and for that I declare a view controller as TTViewController,
I have a view controller whose viewDidLoad method invokes becomeFirstResponder on a textfield (email)
using ARC feature record_audio_testViewController *view2 = [[record_audio_testViewController alloc] initWithNibName:@record_audio_testViewController bundle:nil]; [self.view addSubview:view2.view]; using the
In my application mainviewcontroller is pushing modalviewcontroller by using this [navigationController pushViewController:_viewController animated:YES]; For
I have a problem regarding to MPMoviePlayer. I am using [self presentModalViewController:moviePlayer animated:YES]; to
Using linq2sql I'm trying to take the string in txtOilChange and update the oilChange
I am using 2 views in navigation controller in a tab bar. In that
I am using a NavigationViewController to navigate between master view and detailed views. Now

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.