tags:

views:

20

answers:

1

Hi, i created a sample tabbar application with 4 tabs.When i run the application the default selected tabbarcontroller index is 0.
So when i change this to

self.tabBarController.selectedIndex = 2;

Its loaded the third tabbaritem and its viewcontroller.

What i want is , when i added tabbarcontroller.view to window i want to show a non selected index of tabitem in tabbarcontroller.In that i want to show a temp loading image. After that they clicked the tabbaritem it loaded its view controller.

Can anyone help me? This is possible ? I think its quite diffcult to me....

Note(Mainly i want to show all tabbaritem with non selected index).

A: 

First, when you set SelectedIndex to 2, you get the third tab because the array is zero based (like all arrays in Objective-C). So, the indexes are: 0 => first, 1 => second, 2 => third

I'm not sure what you really want to do. A tabBar cannot have nothing selected, then there would be nothing to display. If you want a temp loading image while the application starts up, look at the documentation and look for 'launch images'.

If you want to show an image AFTER the application has launched but before they select a tab bar index, then just have one of your viewControllers display an image the first time it's launched. i.e.

self.tabBarController.selectedIndex = 0

viewController at index 0 in it's viewWillAppear method just displays and image that says: "Press a button".

joelm