Changing Nav Bar title programmatically

ios, uinavigationcontroller, xcode

Solution

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

Problem

I'm trying to change my nav bar's title programmatically but the code I'm using won't work. ``` self.navigationController.navigationBar.tintColor = [UIColor redColor]; self.navigationController.navigationItem.title=@"Hello"; ``` I can manage to change the colour of the bar but not the text.

Original source