Mir*_*lav 2 iphone objective-c ios
通过调用很容易获得一系列选定的UITableView对象行
[tableView indexPathsForSelectedRows];
Run Code Online (Sandbox Code Playgroud)
有没有办法得到我的tableView 取消选择行的反转数组?
NSMutableArray *unselectedIndexPaths = [NSMutableArray array];
NSInteger sectionCount = self.tableView.numberOfSections;
for (int i = 0; i < sectionCount; i++) {
NSInteger rowCount = [self.tableView numberOfRowsInSection:i];
for (int j = 0; j < rowCount; j++) {
[unselectedIndexPaths addObject:[NSIndexPath indexPathForRow:j inSection:i]];
}
}
[unselectedIndexPaths removeObjectsInArray:self.tableView.indexPathsForSelectedRows];
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
908 次 |
| 最近记录: |