views:

39

answers:

2

It is quiet embarrassing but I just don't get it.

  1. How should I browse prom viewA to viewB to viewC

  2. if I have a main view "viewMain"... how can I make it call a view with a tab bar controller for the views viewTabA, viewTabB and viewTabC. (All views should give me the option to go back to the main view "viewMain")

It just so frustrating that I can't find it on Google: I can't believe that people who are creating a simple game (full screen), and some info "pages", have not solved this before.

I have tried everything...got close but...Please any help, lead, tip would be highly appreciated :_(

A: 

You mean your UITabBarController has three pages A, B, C and you want to change that programmatically?

That's easy. Just do

yourTabBarController.selectedIIndex = ... or
yourTabBarController.selectedViewController = ...

If there you don't find a solution for a problem you think many people face, then almost always the way you are trying to solve it is wrong. :-)

Eiko
The app I want to develop has a main screen(the game)and another screen with the tab controller that switchs between 2-3 screens.If I understand your solution, in the main screen(the first screen of the tab bar), I hide the tab bar(Layout: Wants full screen) and use your code to show another views (in which the bar is visible) and in the other pages I have in the tab bar a button for the "Main page\the game"If I'll have no other choice–I'll do it this way, yet I would really like NOT to have the "main page" button in the tab bar.Do you know a way to achieve what I need?Thanks Asaf
Asaf
You don't have to put every view/view controller you need in the tab bar. It is fine to remove the whole tab-bar-controller-view-thingy from the window and replace it with your main gaming screen, and vice versa. Code is something like [yourTabBarController.view removeFromSuperview] and addSubview:
Eiko
A: 

There is a nice implementation very similar for what I've been looking for in the Stanford University iphone course

http://www.youtube.com/watch?v=4CBMusxvivE&feature=related

Asaf