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

hassoon

macrumors regular
Original poster
Jun 8, 2009
154
0
hi, there is something that bugs me in Xcode. i'm creating an app which uses UiNavigationController however i don't want the navigation bar to appear in the initial window when the app is first loaded. i tried clicking on the Navigation Controller (the one before the root view controller) and in the inspector i chose "none" in the top bar drop down menu (in the attributes inspector). the navigation bar disappears. then i added a custom navigation bar from the library to the view that i actually want the bar to appearing, in order to go back (you can think of it ad the detailed view). however when i run the app the back button doesn't appear although i changed it's title from the inspector and the navigation bar with the title only appears. i feel like i'm changing the back button of the original navigation bar and not the new one. does anyone know how to solve this problem? is there a way to use a navigation bar in like second level or third level view of a navigation controller without letting it appear in the root view controller? thank you! P.S: if you want a visual explanation of my case just create a new project in Xcode with a master-detail template.
 

iJustinCabral

macrumors member
Jul 8, 2012
58
0
Try have more white space between your questions next time. You make your intrigue hard to read, and confusing.

Code:
- (void)viewWillAppear: (BOOL)animated
{
    [self.navigationController setNavigationBarHidden:YES animated:animated];
    [super viewWillAppear:animated];
}

- (void)viewWillDisappear: (BOOL)animated
{
    [self.navigationController setNavigationBarHidden:NO animated:animated];
    [super viewWillDisappear:animated];
}

this should work
 
Last edited by a moderator:

hassoon

macrumors regular
Original poster
Jun 8, 2009
154
0
Try have more white space between your questions next time. You make your intrigue hard to read, and confusing.

Code:
- (void)viewWillAppear: (BOOL)animated
{
    [self.navigationController setNavigationBarHidden:YES animated:animated];
    [super viewWillAppear:animated];
}

- (void)viewWillDisappear: (BOOL)animated
{
    [self.navigationController setNavigationBarHidden:NO animated:animated];
    [super viewWillDisappear:animated];
}

this should work

Thank you so much, yes it did work! and sorry for making it difficult to read my post. have a nice day!
 
Last edited by a moderator:
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.