Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

arnieterm

macrumors regular
Original poster
Aug 28, 2008
201
0
There is a tabbarcontroller with four tabs. For the first tab with its view there is a button on whose click i want to show another view where the user makes some selections and then click a button to come to previous view
How this can be done?
Any idea?
 

robbieduncan

Moderator emeritus
Jul 24, 2002
25,611
893
Harrogate
Sounds like you want a navigation controller. That would allow you to push the second view, get a nice slide right transition and you get the back button for free...
 

davedelong

macrumors member
Sep 9, 2007
50
0
Right here.
You can do this with a TabBarController, too.

When you set up your TabBarController, the various sub-ViewControllers are stored in an array (0-based, of course). If you have four ViewControllers, and you're on the second one and you want to switch to the third one, I believe you can do:

Code:
[[self parentViewController] setSelectedIndex:3];

This is untested, but it should work.

However, ask yourself: Is this really the design paradigm that I want? TabBars are for separating sections of your application by functionality. Take a look at the Clock app. A world clock has a different purpose than an Alarm clock, which are both different from stopwatches and timers. Hence, it's a TabBar.

Contrast this with the Calendar application, where things are done with a NavigationController. This is because the logic flows from one section to the next. Tapping the "Add" button brings up a screen that present a visual logic flow. It's something that would clearly not work as well with a TabBarController.

HTH,

Dave
 

arnieterm

macrumors regular
Original poster
Aug 28, 2008
201
0
My app requirement does not include a navigation controller. Also for the first tab, I want to show another view where after entering some values the user will click a button which will bring him to the previous view
 

admanimal

macrumors 68040
Apr 22, 2005
3,531
2
My app requirement does not include a navigation controller. Also for the first tab, I want to show another view where after entering some values the user will click a button which will bring him to the previous view

That is what you would normally use a navigation controller for.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.