Search code examples
iosuinavigationcontrollerstoryboard

Titles not appearing on the ViewControllers navigation bar


I am currently using the storyboard interface builder to design my GUI.

My structure looks like following in storyboard

-> Navigation Controller -> Tab Bar Controller -> SomeViewController
                                               -> AnotherViewController

Navigation Bar and Tab Bar appears fine in the ViewControllers, and the titles are set and visible in the editor, but in simulation the titles disappear.

How do i resolve this problem?

FYI: Navigation Controller and Tab Bar Controller are not bound to any Custom Class.


Solution

  • self.navigationController.navigationBar.topItem.title = @"YourTitle";
    

    Simply put that in viewDidAppear in your ViewControllers.