views:

25

answers:

2

Here is my situation. I have an app with four tabs. The first tab contains a registration screen. Once the user is registered I want the SAME tab to load a separate "Latest News" screen instead of the registration screen. Any help would be appreciated.

+1  A: 

This sounds like a design issue. It's usually a better idea to display a registration/login view as a modal view. So when the registration is complete, you can dismiss the modal view, and underneath your "latest news" view would already be there. Most likely, you don't want your users to be able to switch to another tab in the middle of the registration process, displaying it modally would take care of that issue as well.

Don't forget that UITabBarController is a UIViewController as well. So you can simply do:

[tabBarController presentModalViewController:registrationController];

And when you are done, dismiss it, and make sure your latest news tab is selected.

Taylan Pince
So, would I load this modal view in the app delegate file?
Liam
Yup, that would be a good place to do so, especially if you are doing an initial check on app launch to see whether you have a registered user or not. If you don't, present the modal view controller, if you do, then let the app progress as usual, displaying your news controller.
Taylan Pince
A: 

Use navigation controller (UINavigationController).

There are plenty of tutorials about iPhone apps navigation on the Web...

Michael Kessler