I have a tabbed application with navigation controllers in tabs and view controller in them. All of them use the same navigation controller navigation bar: back button + logo image. Currently, I'm placing this code in every view controller:
- (void)viewDidLoad
{
[super viewDidLoad];
self.navigationItem.title = @"Back";
UIImage *headerImage = [UIImage imageNamed:@"Logo.png"];
self.navigationItem.titleView = [[[UIImageView alloc] initWithImage:headerImage] autorelease];
}
IMHO it's not the best way to do that. I'm thinking about using a category for UIViewController and to override viewDidLoad method, but every view controller has some additional code to execute in viewDidLoad, so I guess overriding is not the solution. What are the other ways?