Q:

setTint not working

I have a been looking around to change the tint of my UINavigationBar on iOS 5.1.
I have a UITabBarController with two UINavigationControllers attached, the following code is placed in the custom UINavigationController:
- (void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
    [self.navigationController.navigationBar setTintColor:[UIColor blackColor]];
}

...but this does not have any effect.
Thanks in advance.

A:

If you have subclassed UINavigationController (and not having a UIViewController inside a UINavigationController which is most common) then you should do this instead:
- (void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
    [self.navigationBar setTintColor:[UIColor blackColor]];
}

because self is already a navigation controller. Otherwise your code you would have worked just fine (ie You had a UIViewController or one of its subclasses and you've embedded it via code or via Interface Builder into a UINavigationController)

