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

The Archive Base Latest Questions

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

We have a tab bar + navigation control project. We have created a tab

  • 0

We have a tab bar + navigation control project. We have created a tab bar through interface builder and added all tab items to the tab bar controller through through interface builder.
Our application has a login screen which we are showing as a modal form at the beginning. Once the user is authenticated, the login screen is dismissed (using dismissModalScreen) and the MainWindow is shown. This is all working fine.

Now, we have a logout option clicking on which we should show the login screen back. We are able to show that as well. But the issue is once the user is authenticated again, we want all the screens to be loaded freshly. Currently, all screens maintain their state and retain previous data.

What we have tried to do is:

[AppDelegate tabBarController release];

AppDelegate.tabBarController = nil;

We have tried releasing the tabBarController and setting it to nil. But once the view is shown, we are not able to select any of the tabs and the view is blank.

What we need is:

Once the user logs in second time, how to release and reload each viewcontroller which are part of tabbar.

Your help will be greatly appreciated.

  • 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-27T07:29:36+00:00Added an answer on May 27, 2026 at 7:29 am

    We have found a way out. What we are doing now is, once the user logs back in, we are releasing the view controllers and recreating them and setting it back to the uitabbar.

    NSMutableArray *arrControllers = [[AppDelegate.tabBarController.viewControllers] mutablecopy];
    [arrControllers removeAtIndex:3];
    [arrControllers removeAtIndex:2];

    —-Create New Controllers

    UIViewController viewController2 = [[UIViewController alloc] initWithNibName:@”viewController2″ bundle:nil] autorelease];

    UIViewController viewController3 = [[UIViewController alloc] initWithNibName:@”viewController3″ bundle:nil] autorelease];

    –Create Nav controller

    UINavigationController navViewController2 = [[[UINavigationController alloc] initWithRootViewController:viewController2 ] autorelease];

    UINavigationController navViewController3 = [[[UINavigationController alloc] initWithRootViewController:viewController3 ] autorelease];

    [arrControllers addObject:navViewController2];

    [arrControllers addObject:navViewController3];

    [AppDelegate.tabViewController setViewControllers:arrControllers];

    It is working fine after this change.

    Only problem we faced was if we release all objects from the array, we get a carsh. Is it because, when you release allObjects, the first controller which is the RootViewController is getting released?

    Thanks

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

Sidebar

Related Questions

I have a Tab Bar Controller created in Interface Builder Within the Tab Bar
I have a tab-bar and navigation controller application (like Youtube app or Contacts app).
I have a tab bar iPhone application with 4 tabs. In the Interface Builder
I have a tab bar controller and in both tab bar items i have
i have one tab bar controller with 4 navigation controller connection 4 tab bar
Description I have a Tab Bar Controller with a navigation controller tab. The first
I have a tab bar application with a navigation controller and view controllers inside
i have a tab bar control. 1st tab contains a navigation control. On the
I have a Tab Bar controller inside a Navigation controller. I want to create
I have a tab bar with a navigation controller in one of the tabs.

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.