I'm having a strange problem with a UITabBarController in an app I'm working on. The tab bar contains 3 items. The app enables the first two tabs depending on whether a connection to a server is available. When the app first starts, the code appears to be working and the tabs aren't selectable when disabled, but they don't visibly dim and look identical to the enabled tab.
The app starts with a UINavigationController containing a "Connecting" view which is displayed while I attempt to connect to the user's selected server. When the connection succeeds or fails, I update the enabled state of the tabs, then push the UITabBarController onto the root navigation controller's stack (with the first two tabs disabled and the third "Settings" tab selected if the connection fails).
If I change the server selection to another unreachable server, the method that updates the enabled state of the tabs is called (setting the enabled state to NO again) but the tab bar items still visibly look like they're enabled. However, if I select a reachable server (causing the enabled state to be set to YES), then select an unreachable one (setting the enabled state to NO) the disabled items dim correctly.
I've made sure that any code that changes the enabled state always runs on the main thread, and tried calling setNeedsDisplay on both the tab bar items and the UITabBar itself, but so far I've had no luck in getting them to display in the dimmed state.
I hope my long, rambling explanation accurately described the problem - basically, I'd like to know how to a) make sure that the tabs visibly reflect their enabled state when first displaying, or b) manually force the items to redraw when I first display the tab bar controller.