一个页面里面有多个tableview

1.

tableView.tag = xxx;

switch( tableView.tag)
{
//do someting...
}

2.我不喜欢在同一个controller中管理多个tableview,那样会造成比较复杂的逻辑。(每个tableview方法里都有一个switch/case语句)。
建议将tableview设置为不同的controller,然后在主页面中添加这个tableview:[self.view addSubView:controller.view]; 

fromhttp://www.cocoachina.com/bbs/read.php?tid=103956

3.  http://www.cocoachina.com/bbs/read.php?tid=75671&keyword=%B6%E0%B8%F6tableview

-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath

if(tableView == tableview1)
{
cell.textLabel.text = [list1 objectAtIndex:indexPath.row];
}

if(tableView == tableview2)
{
cell.textLabel.text = [list2 objectAtIndex:indexPath.row];
}

if(tableView == tableview3)
{
cell.textLabel.text = [list3 objectAtIndex:indexPath.row];

原文地址:https://www.cnblogs.com/hl666/p/3681884.html