我有一个包含多个部分的UITableView。当我将表设置为编辑模式时,我宁愿一个部分(仅包含1行)不显示编辑符号而不调用tableView:commitEditingStyle:forRowAtIndexPath:。
这可能吗?
问候
约翰
答案 0 :(得分:8)
这里我假设第1节和第0行无法编辑
- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath {
// Return NO if you do not want the specified item to be editable.
if (indexPath.section == 1) {
if (indexPath.row == 0) {
return NO;
}
}
return YES;
}