Hide the title in the navigation bar

Discussion in 'iOS Programming' started by willemVP, Jan 6, 2012.

  1. willemVP macrumors newbie

    Joined:
    Aug 4, 2011
    #1
    I want to hide the title in my navigation bar.
    But I still need my title to go back, so I need to set it.

    How can I hide it?
     
  2. xStep macrumors 68000

    Joined:
    Jan 28, 2003
    Location:
    Less lost in L.A.
    #2
    If you're in a UIViewController, then it may be as simple as;
    Code:
    [self setTitle: @""];
    Otherwise you may need to dig deeper into the UINavigationItem, which a UIViewController has, or even the UINavigationController.
     
  3. xcodeNewbie macrumors member

    Joined:
    Jul 1, 2011
    #3
    Hiding Title

    If you're not in a view controller, you could use the following code:
    Code:
    [[[navigationController viewControllers] lastObject] setTitle:@""];
    Then you'd just have to worry about saving the title somewhere.
     

Share This Page