Normally, the best-practice is to set the title on the UIViewController
. By doing this, the UINavigationItem
is also set. Generally, this is better than programmatically allocating and initializing a UINavigationBar
that's not linked to anything.
You miss out on some of the benefits and functionality that the UINavigationBar
was designed for. Here is a link to the documentation that may help you. It discusses the different properties you can set on the actual bar and on a UINavigationItem
.
Just keep in mind:
UINavigationController
's are your friends.