In IOS4.3 if I set
navigationBar.tintColor = [UIColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:1];
I will get a memory leak: UIDeviceRGBC
Ive had this issue before 4.2, i think colourWithRed:Green:blue allocates a new UIColor object which your responsible for managing.
The solution is to create an instance for your tint colour and release it when your done with your navigation controller in viewDidUnload.
- (void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
tintBarColor = [UIColor
colorWithRed:50.0/255
green:134.0/255
blue:187.0/255
alpha:1];
self.navigationController.navigationBar.tintColor = tintBarColor;
}
- (void)viewDidUnload
{
[super viewDidUnload];
[tintBarColor release];
// Relinquish ownership of anything that can be recreated in viewDidLoad or on demand.
// For example: self.myOutlet = nil;
}