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

  • Home
  • SEARCH
  • 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 8235445
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T18:48:48+00:00 2026-06-07T18:48:48+00:00

I have UITabViewController running with UINavigationController . In each tab i have a different

  • 0

I have UITabViewController running with UINavigationController. In each tab i have a different TableViews that are roots of my application tree.

When i click an item of table, it goes to next level viewing another, detailed TableView, still having TabBar and NavigationBar on screen. It works perfectly, except for one thing. If i’m viewing details in one tab, then switch to another tab, and go back again, then i still see my detail. What i want to achieve, is to reset tab after leaving it.

I expect that i have to put something in viewDidUnload or simmilar, but couldn’t find the right solution.

Hope you can help.

  • 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-07T18:48:51+00:00Added an answer on June 7, 2026 at 6:48 pm

    at

    - (void)tabBarController:(UITabBarController *)tabBarController didSelectViewController:(UIViewController *)viewController
    

    do

    [viewController.navigationController popToRootViewControllerAnimated:YES];
    

    That will navigate the tab’s view controller to the root view whenever the tab is selected.

    That’s completely OK to keep your main window view controller (tab bar controller) instance at application delegate.

    What you need to add is to set the delegate or whatever other initialized class to be the tab bar controller’s delegate like this:

    myTabBarController = [UITabBarController alloc ...
    myTabBarController.delegate = self; // the app delegate will be also the tab bar delegate
    

    in the app delegate, then you add the following method to the app delegate:

    - (void)tabBarController:(UITabBarController *)tabBarController didSelectViewController:(UIViewController *)viewController{
        [viewController.navigationController popToRootViewControllerAnimated:YES];
    }
    

    The tab bar controller will call this method whenever it’s tab is selected.
    You will also want to make the application delegate confirm UITabBarControllerDelegate this way:

    @interface PSAppDelegate : UIResponder <UITabBarControllerDelegate>
    

    that will let the compiler know that app delegate must or might have the methods declared in the protocol and will also give you so convenient auto-complition of this method.

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

Sidebar

Related Questions

I have a UITableViewController that displays cells that are just default. Each cell can
I have a UITableViewController that when opened displays a table of the following object:
I have a UITableViewController with a table view that works perfectly when in portrait
I have a UITableViewController with a subclass of UITableViewCell with a UITableView in each
I have a UITableViewController and UITableViewCell . This cell contains three text fields. Each
My application has a view controller that extends UITableViewController . The initialization method looks
I'm working on an ios app with uitabviewcontroller that plays some music. I don't
I've got a project setup using a Storyboard that contains a UITabViewController as the
I have a UITableViewController that contains a tableView. I want to set its scrollView
Hey everyone, running into a bit of an issue, I have created all my

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.