Hide Segemented Control on NavBar, then add Title

Posted by Jordan Clark on Stack Overflow See other posts from Stack Overflow or by Jordan Clark
Published on 2012-05-31T04:35:34Z Indexed on 2012/05/31 4:40 UTC
Read the original article Hit count: 179

Basically I have a Segmented Controller on my NavBar right in the middle. What I want to be able to do is hide the Segmented Controller and add a title to the navigation bar. But with my code, the segmented controller is being hidden, but the title will not add, thus leaving a blank NavBar. This is my simple code in .h:

IBOutlet UISegmentedControl *toggleDay;
IBOutlet UINavigationBar *navBar;

And this is my code in my .m:

toggleDay.hidden = YES;
navBar.topItem.title = @"Title";

Any help would be great thanks!

© Stack Overflow or respective owner

Related posts about navigation

Related posts about uinavigationbar