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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T04:35:30+00:00 2026-06-03T04:35:30+00:00

The problem is pretty simple to understand with pictures. I have a UINavigationController that

  • 0

The problem is pretty simple to understand with pictures.
I have a UINavigationController that allow the user to switch between to views.

The first view contains a search bar and a table view like so :enter image description here

The second is a basic view where information about the cell are display

When I click on the search bar, the navigation controller gets hidden and the search bar is now at the top.

Now, if I click on a cell, it goes to the second views, but the navigation bar is first hidden like below :

enter image description here

And then, it automatically appears like that :

enter image description here

I have tried a couple of things like show the navigation bar before pushing the next view controller but it is quite ugly..
Does anyone know how to have the show the navigation bar directly on the second view (like in the contact application)?

[UPDATE] : Code

AppDelegate.m (I’m talking about navigationcontroller2)

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{    
    self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
    FirstViewController *viewController1 = [[FirstViewController alloc] initWithNibName:@"FirstViewController" bundle:nil];
    SecondViewController *viewController2 = [[SecondViewController alloc] initWithNibName:@"SecondViewController" bundle:nil];

    viewController1.managedObjectContext = [self managedObjectContext];
    viewController2.managedObjectContext = [self managedObjectContext];
    viewController1.viewController2 = viewController2;

    UINavigationController *navigationcontroller1 = [[UINavigationController alloc] initWithRootViewController:viewController1];
    [navigationcontroller1.navigationBar setTintColor:[UIColor lightGrayColor]];
    UINavigationController *navigationcontroller2 = [[UINavigationController alloc] initWithRootViewController:viewController2];
    [navigationcontroller2.navigationBar setTintColor:[UIColor lightGrayColor]];

    self.tabBarController = [[UITabBarController alloc] init];
    self.tabBarController.viewControllers = [NSArray arrayWithObjects:navigationcontroller1, navigationcontroller2, nil];

    self.window.rootViewController = self.tabBarController;
    [self.window makeKeyAndVisible];

    return YES;
}

FirstView.m

- (void) searchBarTextDidBeginEditing:(UISearchBar *)theSearchBar {
    [self.navigationController setNavigationBarHidden:YES animated:YES];
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    if (!noResultsToDisplay) {
        PinDetailsViewController *pinDetailsViewController = [[PinDetailsViewController alloc] initWithNibName:@"PinDetailsViewController" bundle:nil];
        NSManagedObject *managedObject = [fetchedResultsController objectAtIndexPath:indexPath];
        Pin *pin = (Pin *) managedObject;

        [self.navigationItem setTitle:@"Pins"];
        [self.navigationController pushViewController:pinDetailsViewController animated:YES];
        [pinDetailsViewController updateWithPin:pin];
    }
}

If you need anything else, just ask but I think it’s all there.

  • 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-03T04:35:32+00:00Added an answer on June 3, 2026 at 4:35 am

    Try to use this code in each viewcontroller.

    - (void) viewWillAppear:(BOOL)animated
    {
    
        [self.navigationController setNavigationBarHidden:NO animated:animated];
    
    }
    
    
    - (void) viewWillDisappear:(BOOL)animated
    {
        [self.navigationController setNavigationBarHidden:YES animated:animated];
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a pretty simple problem. Basically I have an array called $list that
I have a problem with WCF. My testing code is pretty simple. I call
I'm having a problem with a pretty simple setup in NHibernate. (I'm using Fluent
I've got a pretty minor problem that I think can be resolved by re-thinking
I have a pretty basic problem but I can't seem to figure it out...
I have a pretty big problem with my TabHost. Although I have declared all
My problem is perhaps pretty simple, but I just started programming in C#. My
I'm pretty new to Python, so hopefully the problem I'm having has a simple
I have - I think - a very simple problem I want to align
I am experiencing several issues that I can't understand from the first glances. The

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.