Hide the title in the navigation bar

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

  1. willemVP macrumors newbie

    Aug 4, 2011
    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

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

    Jul 1, 2011
    Hiding Title

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

Share This Page