0

I have created a Windows application.in my appdelegate I have called a controller class named analogcontroller and added this class to my window so that when I run my application the page that should come first is this page that contains an analog clock with five tabbaritems in it each calling different class.

So in the analog controller class xib I have added a tabbar with 5 tabbaritems in it. But when I run my application the page that gets opened is the page of the firsttabbaritem instead of analogcontroller. I want that when I run my application my xib of analog controller should be called with 5 tabbar items below it and when I click on particular tabbaritem then only its corresponding page should be opened, otherwise not. How is this possible?

halfer
  • 19,824
  • 17
  • 99
  • 186
Rani
  • 3,333
  • 13
  • 48
  • 89
  • -1: While people around here usually are more than willing to do basic cleanup tasks on your question; at least a modicum of effort *is* necessary. – Williham Totland Aug 03 '11 at 11:48
  • Possible duplicate of [How to set the Tab bar item 1 to be selected by default in iphone?](https://stackoverflow.com/questions/2325780/how-to-set-the-tab-bar-item-1-to-be-selected-by-default-in-iphone) – halfer May 31 '18 at 23:25
  • The accepted answer is nothing more than a link to another question, so this question can be regarded as a duplicate. – halfer May 31 '18 at 23:26

2 Answers2

0

you can set tabbar selected index to your desired tab index it starts from 0

you can write something like tabbarcontroller.tabbar.selectedindex =1;

Forgive syntax errors... you should try this. xCode is rich editor.

user869123
  • 257
  • 4
  • 15
0

If you have a visible tabBarController, then something will necessarily be selected. No way around this.

However, if you would like to hide the tabBar, then you can certainly do that, either by setting its hidden property to YES or by presenting a modal view on top of the selected tab (e.g. the first viewController).

similar question here

Community
  • 1
  • 1
Maulik
  • 19,348
  • 14
  • 82
  • 137