views:

72

answers:

2

Hi Guys,

I am fairly new to programming and I am working with Objective C. I am trying to program an app where you have a UITableView, than you click on cell, which will bring you to another UITableView with more options. I have only encountered problems, however, in populating this second UITableView. Any suggestions for how to do this? Do i need to create new classes for each new table?

Thanks for any help!! Ben

+1  A: 

Your question's a bit vague, but it sounds like you need two UITableViewControllers:

ParentUITableViewController: This houses the top level table view that, when you tap on an element, moves you to the second

ChildUITableViewController: Houses the child table view that populates itself based on what was tapped on the first

The Apple examples are excellent for learning this sort of architecture, this one may be exactly what you're after: DrillDownExample

drewh
Thanks for the help, sorry I was vague, it seems to have been my downfall. I am actually programming for the Iphone and I am trying to program an app that has two layers as you described. The first layer is a table, and than you click on one of the cells and it goes to the next layer which is also a table. I've had trouble trying to figure out how to populate this second table. Thanks again for your help!
Tarhab
I'd suggest looking at the UITableView samples on the Apple Developer site, including the Recipes example. It does this and more.
Hunter
A: 

You could also look into a UINavigationBar if you are going to navigate through tables and want to go back and forth between them (once you get it connected to everything correctly, UINaviagationBars can be great, because you don't have to worry about what level you are at in your tables, it takes care of it for you! but like i said, after you hook it up right, which is a pain in the butt)

Wolfcow