一个UIViewController中的两个UITableView [英] Two UITableViews in one UIViewController

查看:99
本文介绍了一个UIViewController中的两个UITableView的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个UIView。它包含两个UIScrollView,每个UIScrollView包含一个UITableView。

I have a UIView. It contain two UIScrollView, and everyone UIScrollView contains one UITableView.

当我用数据填充表时,第一个表填充数据,但第二个表保持为空。

When I fill tables with data, the first table gets filled with data, but the second table remains empty.

可能出错?

调试后我看到了

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

仅为第一个表调用。但

(UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section

为每张桌子调用

! - >也没有委托或数据源的问题...

was called for every table!!! --> also no problems with delegate or datasource...

请帮助。

我正在使用逻辑:

if(tableView == self.tableU1){
  ... 
  } 
else{
...
}

用于区分表格。

推荐答案

这个问题可能有用:

iPad - 同一屏幕中的多个UITableView

你完全相信你已经把的代表连接到了两个表的数据源,对吧?仔细检查!

You're absolutely sure you've hooked up both the delegate and the data source for both tables, right? Double check!

这篇关于一个UIViewController中的两个UITableView的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆