I'm encountering a very weird problem which is driving me crazy.
The problem is that sometimes (it doesn't always happen), after showing a popup, the bar buttons and any UISegmentedControl become red, while they should be white (see the pictures below).
Here is also the code (in the app delegate initialization method) with which I set the the tint color of my app:
[[UINavigationBar appearance] setTitleTextAttributes: [NSDictionary dictionaryWithObjectsAndKeys:
[UIColor redColor], NSForegroundColorAttributeName,
shadow,NSShadowAttributeName,
[UIFont fontWithName:@"HelveticaNeue-Thin" size:18],
NSFontAttributeName,
nil]];
[[UIBarButtonItem appearance] setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:
[UIColor redColor], NSForegroundColorAttributeName,
shadow,NSShadowAttributeName,
[UIFont fontWithName:@"HelveticaNeue-Thin" size:18],
NSFontAttributeName,
nil] forState:UIControlStateNormal];
if ([self.window respondsToSelector:@selector(setTintColor:)])
self.window.tintColor = [UIColor redColor];
[[UINavigationBar appearance] setBarTintColor:[UIColor whiteColor]];
[[UINavigationBar appearance] setTintColor:[UIColor redColor]];
[[UITabBar appearance] setTintColor:[UIColor redColor]];
[[UITabBarItem appearance] setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:[UIColor redColor], NSForegroundColorAttributeName, nil] forState:UIControlStateSelected];
[[UITabBarItem appearance] setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:[UIColor darkGrayColor], NSForegroundColorAttributeName, nil] forState:UIControlStateNormal];
Any idea of why this is happening? I think that if there was a problem in my code, navigation bar buttons and segmented controls would be red since the app was launched, not after a while. What do you guys think?
Thanks