Multiple UITabBarControllers - iphone

I want to make an App that has multiple UITabBarControllers. The idea is that when the app launches, the user has 3 options, and based on what option he chooses decides which UITabBarController is displayed. (i have kinda got this bit working atm). BUT i want the user to be able to go back to the beginning and choose another option, again displaying a different UITabBarController. - this is where i am stuck
can anyone help me? or suggest the best way to handle this.
Thanks
Sam

I would choose a UINavigationController to be the rootViewController of the window object.
The first UIViewController shows the options for the three tab bars. Depending on the selection you can push a specific UITabbarController to the UINavigationController. May this idea help?

Related

Change UITabBarController

I want to ask if it is possible to change UITabBarController to another UITabBarController as you navigate through your app?
Like... I have 3 tabs, the one is a navigationcontroller. When I navigate through the tab with the UINavigationController, I will have 2 other tabs.
I just want to know if it's possible and a hint.
Thanks.
As commented by Bourne that's not a good idea, not easily possible (you'd have to remove the tabbarcontroller then create another and remove that and re-add the first one when you wanted to go back) plus it would confuse users and Apple likely wouldn't allow it in the app store.
It would be better to have a toolbar inside a tabbar.

Multiple ViewController - Best Approach

I have a very large form to build in my ipad application and I'm note sure which approach( between create multiple views in or multiple viewcontrollers ) to follow. Well, I have decided to split may form in logical sections, so I want use a splitviewcontroller with a root( a tableviewcontroller with the sections) and multipleviecontrollers for each sections. When the user select a row in tableview I will show the correspondent viewcontroller. I'm saving a reference for each viewcontroller in my app_delegate and the app_delegate also is the responsible for change the viewcontrollers. Is this the best approach? There is other approach to follow? About the multiple view I was thinking to put multiple view in the same xib file and then choose based in tag as the use tap the row in rootviewcontroller's tableview.
Thanks in advance. And sorry for my bad english.. Learning!
I will say this on the subject: currently, having multiple view controllers on the screen at the same time can be problematic if you're not using one of Apple's existing classes, such as a UISplitViewController.
The main issue is that important events your view controllers will want to respond to (rotation events, etc) won't be passed down to them. It's not a huge pain, it's just something to need to take into account - you'd typically create your own parent view controller that could pass these events down to its children.
Now, you are using a split view controller, so alls well on that front. There is no provided way for detail and master controllers in a split view controller to communicate with each other, but Apple recommend you employ a standard delegation pattern. If your application is fairly simple this could certainly happen in your app delegate as you do now.
If you're targeting iOS 5 only there are some changes that are relevant regarding multiple controllers on the screen at the same time, but I can't discuss them on here because of the NDA. You should go to Apple's developer forums (devforums.apple.com) to learnmore.
Sounds like I'm trying to do the same thing as you (large insurance forms here, how about your project?) Unfortunately I can't help out as you're a bit ahead of me. I've been able to flip back and forth between 8 detail views by tapping on the 8 rows in my UITableViewController, without keeping a reference to either the current or previous one anywhere. The data I enter into various TextFields stays where it should.
I currently have a xxxViewController.h/.m and corresponding .xib file for each detail view. That's an awful lot of code, but I couldn't see any other way to do it. Now I'm having a problem getting my button pressed handlers to fire. Also I've still got to put a database behind these screens.
Were you able to overcome your issue?
Thanks,
Jeff in Alabama

Do I need a UINavigationController?

I'm building my very first iPhone application.
It's pretty simple, I'm displaying two lists the user can switch between using a tabbar.
I'm unfamiliar with the IB, so I'm building the UI from scratch, hoping to learn a thing or two about the inner workings that would otherwise be hidden.
My question for SO is:
Do I need a UINavigationController? There are no levels of navigation to this (yet), so the navigation stack described here seems excessive.
What's SO's advice?
Short answer: You don't need a UINavigationController.
Longer less definitive answer: Since you are just starting out I wouldn't mess with the UINavigationController just yet. Get comfortable with the UITabController and the two view controllers you need to show on each tab.
At some point, though, you may want to consider experimenting with the UINavigationController as you may find you want something to happen when a user taps on a list item within one of those lists. Perhaps you'll want to show more detail at that point, show a map, or a form, etc. That's when the UINavigationController is going to come in handy.
Well......... no you dont need one. But yes, I would take the time to use one. The UINavigationController and the UITableViewController are the two most used controllers in the iphone SDK. Better get to know them if you want to be an IOS programmer.
Also.. you said that you dont need "levels of navigation... yet". Better do it right from the beginning or you will be redoing all your code later on.
just my two pesos.
If you have two completely separate views, a UITabBar would be the far better pick.
This just shows a "ribbon" of sorts at the bottom of the screen which allows for choosing an option. The UITabBar is generally used for switching completely unrelated views, such as your use case.
On the other hand, a UINavigationController is used to form a tree-like hierarchy or drilldown and is ill suited for your use case.

UIWindows or UIViews

I need three different sections in my app: a login screen, a main screen, and one that takes place in landscape mode, all totally different. I saw Apple insists that an app should have one window, so I'm asking: what would be best to use for this? Three big windows, or views?
And how should the hierarchy look like? I don't have experience with layers for example. And while the login panel can go away after the user gets logged in, the other two must remain the same no matter which one of them is visible.
Also, no matter what your answer is, how exactly would the new UIWindow flow look like? How do I attach it instead of the initial one? do they have layers? etc.
Thanks!
as you have said you can only have one uiwindow so you will need 3 views that you can add them manually using add subview to your main window or use the interface builder to make navigation controllers or tab-bar controller etc... which seems a better solution
resources
for basic difference between uiwindow
and uiview see this
for uiview controllers guide
this will be helpful
and here is the interface builder
guide

UITabbarController problem

I Have two xib files named firstView and SecondView ........
I implemented these into tabbarcontroller items...Now its work fine..
When i select firsttabbaritem firstView was loaded also select second tabbaritem its loaded secondview...
i have back button in the SecondView ...If some one clicked these back button means how can i load firstView?....
Can anyone help me?
Thanks in advance........
I think that Apple's usability guidelines might encourag you not to use a back button to change tabs.
If you must - look at UITabController.selectedTabIndex
This is definitely not how your users are going to expect the interface to work. Back buttons are for navigating back up a NavigationController stack. A Tab Bar is for navigating between completely independent NavigationController stacks.
Think about it in terms of a browser. If I go from Site A to Site B, then switch tabs... I don't want my NEW tab to go back to Site A.
You really ought to seriously consider what it is that you are trying to do, and whether or not it makes any sense to an end user.