iphone - 如何在iPhone中的单个 View Controller 中使用两个以上的UITableView

标签 iphone xcode uitableview

我在 UIViewController 中使用两个 UITableView,如何填充两个 TableView 中的行和单元格?当我给出第二个 TableView 时,它显示了节中行数的重复声明等。

最佳答案

这就是为什么 dataSource/delegate 方法有一个 tableView 参数。根据其值,您可以返回不同的数字/单元格/...

- (void)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    if (tableView == _myTableViewOutlet1)
        return 10;
    else
        return 20;
}

关于iphone - 如何在iPhone中的单个 View Controller 中使用两个以上的UITableView,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11823565/

相关文章:

ios - 调整 UITable 标题 View 的大小自动布局

ios - 通过 didSelectRowAtIndexPath 添加 NSManagedObject 到 NSMutableArray

iphone - UISegmentedControl`` 在导航项上使 Xcode 崩溃

iphone - 将 plist 复制到文档目录

iOS SDK 导航 Controller : Autmoatically close/dismiss child view?

iphone - 通过从右侧移动到其原始位置来对 UIButton 序列进行动画处理

ios - 在 iOS 开发中,您可以拥有两个版本的 .nib 文件并使用各自的方案编译每个版本吗?

XCode 3.2 : Changing the default "Code Sense" indentation and whitespaces

ios - 在呈现另一个 ViewController 时关闭 ViewController

ios - TableView Controller 的奇怪行为