views:

30

answers:

2

Hi all, Just a short conceptual question: I am making an ap that has a tabviewcontroller on root level. Every tab contains a table with 2 drill down levels and at the end one detail view.

What is the approach ? I think a TabBarController that Contains NavigationControllers that contain TableViewControllers ? Is that right ? So far so good. But i am not quite sure what the appropriate way is to create those NavigationViewcontrollers. Should I create them with IB and then use "Write class Files" to get the .m and .h ? or is there a more straight foreward way ? tia Heiko

A: 

I had a similar challenge and found this excellent video on doing it. A quick google search will also produce some useful tutorials.

Felixs
A: 

Here's the basic setup in IB:

  1. In IB, drag two Navigation Controllers out of your library and drop them on your Tab Bar Controller so that they appear to be nested underneath it.

  2. Now drag two Table View Controllers out of your library and drop one onto each of your two Navigation Controllers.

  3. In code, create two UITableViewController subclasses to populate your top-level tables.

  4. Back in IB, select your first Table View Controller, bring up the inspector, go to the "Identity" tab, and change the Class field to the name of your first UITableViewController subclass. Change the class of the second Table View Controller in the same way to match your second UITableViewController subclass.

You now have a basic setup that will give you a Tab Bar Controller with two Navigation Controllers, which have their root View Controllers set to your two custom UITableViewController subclasses.

When users drill down in tableView:cellForRowAtIndexPath:, you can construct your lower level view controllers in code and navigate to them using [self.navigationController pushViewController:yourDrillDownViewController animated:YES];

cduhn
Thanks alot. Very helpfull
HeikoG