ipad - iPad:遍历UITableView中的每个单元格吗?

标签 ipad uitableview

iPad:遍历UITableView中的每个单元格吗?

最佳答案

for (int section = 0; section < [tableView numberOfSections]; section++) {
    for (int row = 0; row < [tableView numberOfRowsInSection:section]; row++) {
        NSIndexPath* cellPath = [NSIndexPath indexPathForRow:row inSection:section];
        UITableViewCell* cell = [tableView cellForRowAtIndexPath:cellPath];
        //do stuff with 'cell'
    }
}

关于ipad - iPad:遍历UITableView中的每个单元格吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5644635/

相关文章:

ios - 具有多行 UILabel 的自定义 Tableview 单元格需要动态高度

swift - 如何使 ScrollView 内的 TableView 的滚动行为自然

ios - AutoLayout 标签在屏幕右侧被截断

iphone - 如何在 iPhone/iPad 上存储非常大的图像

ios - 为什么我的 UIButton 没有显示在我的 subview 中? iPad应用程式

css - 响应式设计适用于浏览器,不适用于 Landscape Ipad

ios - SpriteKit - physicsBody 不尊重边缘

ios - 长按模式下的 Collection View 时,如何移动 Collection View 单元格并在 iOS 中重新排列它们?

ios - 仅在 UITableViewCell 中禁用 UIScrollView 的垂直滚动

uitableview - 使用自定义 UITableViewCell 时检测 UIButton