views:

43

answers:

2

Hi All,

Guys, i am a newbie in iPhone but not to Programming, my doubts are,

  1. Is it possible to add more than one UITableView in the same screen? ,if so please provide me with sample code / resource where i can find..

  2. The Second UITableView has to be changed accordingly based on the selection in the First UITableView.

Thanks in Advance

A: 

Here's a sample code. But the better approach is, yes, to have different delegates/datasources for both tables.

To change table2 contents depending on a table1 selection, you may just use [table2 reloadData] in a

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
kovpas
+1  A: 

It's possible, but in the sense you're describing is probably a UI convention violation. You should be presenting one UITableView per screen, where tapping a row on the first "drills down" into a second UITableView -- like a hierarchy.

Shaggy Frog