This is what I did so far:
- I created a new view based iPhone application
- I added a navigation bar to the xib file
How do I set the title of this navigation bar?
- If I try
[self setTitle:@"Test"]inviewDidLoad, the title of the navigation bar doesn’t change, but rather it remains “Title”. - If I try
[[self navigationItem] setTitle:@"Test"], the title becomes empty.
How can I change this title?
If the view was pushed onto the navigation stack, then
should exactly work. However, since you created the bar in the xib file, try making an
IBOutletfor it, and then access thetitleproperty through the pointer.