Setting the name UINavigationBar

I have an application that uses the main board to enable the navigation controller, where the main view is to present the table using the contents of the prototype cell. Each cell in the table view clicks on a new view that I created with its own set of .hm and .xib files.

The navigation bar in the form of a table has its own title, set through the story bar, which works fine. However, I had problems setting the title for each new view after entering it in the field of view.

I have the following in the viewDidLoad method for each view;

self.title = @"View Title";

Any tips?

+5
source share
3 answers

this is the right way. he will work.

+5
source

I am doing something similar in the application I'm working on. This is how I set the title:

[[self navigationItem] setTitle:@"My View Title"];

I think the equivalent of dot notation would be something like this:

self.navigationItem.title = @"My View Title";

Hope this helps.

+1
source

If you have a tab bar controller, try the following:

self.tabBarController.navigationItem.title = @"Title";
0
source

All Articles