Я пытаюсь удалить UITableviewCell
жестом салфетки.Кнопка удаления остается отображаемой при использовании commitEditingStyle (cf gif)
- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath
{
return YES;
}
С
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath {
if (editingStyle == UITableViewCellEditingStyleDelete) {
[_commentsData removeObjectAtIndex:indexPath.row];
_NBComment--;
[tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath]
withRowAnimation:UITableViewRowAnimationFade];
}
}
Результат таков:
В удаления кнопок остается на дисплее после удаления строки.
У вас есть идея сделать удаление строк более плавным?
Заранее спасибо
Спасибо за ваш ответ, но на самом деле этот код написан для того, чтобы избежать использования 'reloadData'. Когда я использую reloadData после удаления, у меня есть сбой (cf http://stackoverflow.com/questions/18394816/at-caneditrowintindexpath-method-reloaddata-of-uitableview-not-work-properly) – Vico