当用户按下工具栏中的按钮时选择表格(UITableView)中所有单元格的最佳方法是什么?
最佳答案
这是我遍历表格的方法,效果很好。
for (int i = 0; i < [ptableView numberOfSections]; i++) {
for (int j = 0; j < [ptableView numberOfRowsInSection:i]; j++) {
NSUInteger ints[2] = {i,j};
NSIndexPath *indexPath = [NSIndexPath indexPathWithIndexes:ints length:2];
UITableViewCell *cell = [ptableView cellForRowAtIndexPath:indexPath];
//Here is your code
}
}
关于iphone - 选择 UITableView 中的所有单元格,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1524043/