Я хотел бы знать, есть ли способ остановить появление кнопки «очистить» на определенной ячейке uitableview и позволить ей появиться на другой?
Я настроил обычную ячейку uitableview, в которой есть кнопка, я использую
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath
{
метод .. Я хотел бы знать, если вы можете остановить кнопку, которая появляется на одном из нескольких uitableviewcells, когда пользователь удаляет пальцем?
- (NSString *)tableView:(UITableView *)tableView titleForDeleteConfirmationButtonForRowAtIndexPath:(NSIndexPath *)indexPath
{
return @"Clear";
}
// Override to support editing the table view.
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath
{
if (indexPath.section == 0)
{
//cell fade - notifies the user that they are edited their cell
NSArray *rowArray = [NSArray arrayWithObject:indexPath];
[self.tableView reloadRowsAtIndexPaths:rowArray withRowAnimation:UITableViewRowAnimationFade];
if (indexPath.row == 0)
{
manufactureSearchObjectString = @"empty";
[self.tableView reloadData]; //reloads the tabel with new value
manufactureResultIndexPath = nil; //removes tick from subview
}
else if (indexPath.row == 1)
{
}
else if (indexPath.row == 2)
{
}
else if (indexPath.row == 3)
{
keyTypeSearchObjectString = @"empty";
[self.tableView reloadData]; //reloads the tabel with new value
keyTypeResultIndexPath = nil; //removes tick from subview
}
}
else if (indexPath.section == 1)
{
if (indexPath == 0)
{
//can I stop the "clear" button from showing in here?
}
}
}
Чтобы быть более конкретным, я хочу, чтобы это не произошло
