views:

41

answers:

1

I have a .h file containing... myViewController : UIViewController {}

in the .m file I need to load either another view or a tab view depending on choice of the user.

Does anyone have a good example that I can borrow and learn from ??

thanks!!

A: 

Why not create a separate view controller for each of those views, and select the right view controller based on the users choice?

Pieter Witvoet
is that the preferred/most used method ? do you have an example of that branching and instantiating views?
CocoaNewBee
It's just better for organization, otherwise you'll have to add various checks inside your view controller to determine which view you're actually working with. Just create both controllers in advance, and push the desired one onto the navigation stack, or put both under a tab controller, depending on what you want.
Pieter Witvoet
thank you Pieter.. great advice! I have several views in one UIViewController and a TabBArController. I suppose the principle is the same correct?
CocoaNewBee