Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

chhoda

macrumors 6502
Original poster
Oct 25, 2008
285
1
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

Code:
- (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 ?

regards
 
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 ;)
 
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
Code:
	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.
 
Last edited:
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.