views:

41

answers:

1

Hey guys,

Something very strange is happening to me. I've been double and triple checking myself. I'm using a UITabBarController, and initializing it with 4 different view controllers. However, for some reason, when the application starts, only the first tab bar image is displayed. It's only when I touch the blank part of the tab bar - then the underlying image suddenly appears.
I suspect it's a bug introduced in the latest SDK - I've just updated to Xcode 3.2.4 with iOS SDK 4.1. Has this happened to anyone else? Or perhaps - any idea what could cause this?

Thanks!
Ariel

A: 

Hi again,

I found my problem. It wasn't a bug in the new Xcode version, it was my own mistake of course, and thank you guys for trying to help.

The problem was I was initializing my UITabBarItems in the viewDidLoad function of the various view controllers. However, this function was invoked only for the first view controller (the one being displayed) and wasn't invoked for all other view controllers until I touched the relevant tab bar button. And therefore, only when touching the button, the tab bar item was initializing and appearing.

The solution was to initialize the UITabBarItems in the init function of the UIViewController.
Now it all works just fine :-)

Thanks again guys!
Ariel

Ariel