- Add 2 UITableViews to your view in IB and connect them to two different outputs in the file owner (or just assign different tag properties).
- Set a delegate and a data source for them (there may be one and the same view controller for both).
In the delegate / data source methods, you do the following:
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
if (tableView == myFirstTable)
if (tableView == mySecondTable)
return 0;
}
or if you use the tag approach:
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
switch(tableView.tag){
case firstTag:
case secondTag:
}
return 0;
}
source
share