Plz指导我如何在UIViewController中使用2个UItableView(或更多)并管理它们的
numberOfRowsInSection,......和其他方法.
任何想法?
假设您的实际问题在于分配与UITableViewDelegate相同的对象:
UITableViewDelegete方法将UITableView实例传递给它.您只需要过滤掉需要操作的tableview.例如:
- (void)tableView:(UITableView *)tableView didDeselectRowAtIndexPath:(NSIndexPath *)indexPath {
if (tableView == yourFirstTableView) {
// <do whatever on first table view>...
} else if (tableView == yourSecondTableView) {
// <do whatever on second table view>...
}
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
5062 次 |
| 最近记录: |