hide nav bar

Discussion in 'iOS Programming' started by chhoda, Jun 26, 2012.

  1. chhoda macrumors 6502

    Oct 25, 2008
    i have a nav bar based app, where, only for the first screen i need to hide nav bar and everything else i need to show nav bar.

    i am doing following in the firstviewcontroller

    - (void) viewWillDisappear:(BOOL)animated {
    	[super viewWillDisappear:animated];
        self.navigationController.navigationBar.hidden = NO;
    - (void) viewDidAppear:(BOOL)animated {
    	[super viewDidAppear:animated];
            self.navigationController.navigationBar.hidden = YES;
    Everything works fine, i am on a snow leopard 10.6.8 and xcode 4.2

    but my customer complains that nav bar is visible in his system in secondviewcontroller but back button is missing, hence he cannot come back to first view controller when he goes to secondviewcontroller.

    I am unable to reproduce it in my environment in 3 mac machines.

    i have not tested in lion as yet, as I need to purchase Lion dvd to upgrade [am i right ?]

    what could be possible solution ?

  2. jnoxx macrumors 65816


    Dec 29, 2010
    Aartselaar // Antwerp // Belgium
    I think you need to ask his iOS version. Since the code looks fine. The only thing why a back Button could be missing is that you DONT have a title set on the view controller, therefore a nil back button is created ;)
  3. chhoda, Jun 26, 2012
    Last edited: Jun 26, 2012

    chhoda thread starter macrumors 6502

    Oct 25, 2008
    I do set the title. in second view controller ViewDidLoad !

    He runs in lion, hence I guess xcode 4.2 ios 5 sdk

    i am also changing the right bar button in secondviewcontroller
    	UIBarButtonItem *rightBarButton = [[UIBarButtonItem alloc] initWithTitle:@"Email" style:UIBarButtonItemStylePlain target:self action:@selector(sendEmail:)];          
    	self.navigationItem.rightBarButtonItem = rightBarButton;
    	[rightBarButton release];
    could that be causing a problem ?

    very diffy to say as i am unable to see that problem in my machine.

Share This Page