Q:

TabBarController + TableViewController + Navigation Controller?

I'm new to iphone development, and I want to make an app combining TabBarController + UITableViewController + UINavigationController. I know this question was widely discussed in some video tutorials and threads, but some of them are for old xcode and sdk versions, and I have problems when working through the tutorials.
I will be glad if someone could help me with an up to date tutorial or source files.
To be clear, I'm trying to have my app based on a tab bar controller with two tabs: the second will be a simple view, and the first should contain a tableviewcontroller and a navigation controller. When I click on a cell, it should move to another "detail" view.
Any help will be great.

A:

Ok this is going be long:
in the AppDelegate.h
allocate a UITabBarController a UINavigationController and 2 UIViewControllers
for example:
UITabBarController *mainTabBar;
UINavigationController *navController;
UIViewController *firstViewController;
UIViewController *secondViewController;

then move to AppDelegate.m and instantiate each of those 4 items like this:
mainTabBar = [[UITabBarController alloc] init];

firstViewController = [[firstView alloc] init];

do that for both views
then if you want to set the title of either of the views, (this will be the title that shows up in the tab bar) do it as follows:
firstViewController.title = @"Welcome";

Then create the UINavigationController for the view that has a UITableView inside it like this:
navController = [[UINavigationController alloc] init];
[navController  pushViewController:firstViewController animated:NO];

Now you have a UIViewController and a UINavigationController with a UIViewController inside it.
All thats left is to put your two tabs into the UITabBarController:
mainTabBar.viewControllers = [NSArray arrayWithObjects:firstViewController, secondViewController,  nil];

then just put the tab bar controller on screen and you should be good to go:
[window addSubview:mainTabBar.view];

A couple things to remember:

make sure you release everything you called alloc on so your using good memory management.
Make sure you import all the files you intend on using in AppDelegate.h, it should look something like: #import "FirstView.h

Let me know in a comment if you have any questions

