Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/97.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 在UITableView中滑动以取消输入而不是删除_Ios_Cocoa Touch - Fatal编程技术网

Ios 在UITableView中滑动以取消输入而不是删除

Ios 在UITableView中滑动以取消输入而不是删除,ios,cocoa-touch,Ios,Cocoa Touch,当用户滑动tableview单元格时,我使用以下代码显示删除按钮。我想在这个按钮中写取消而不是删除,我怎样才能实现这个功能 - (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath { return YES; } 及 如果您只想将按钮的标题更改为“Cancel”,那么只需在表视图的委托中实现-tableView:titleForDeleteConfirmationBut

当用户滑动
tableview
单元格时,我使用以下代码显示删除按钮。我想在这个按钮中写取消而不是删除,我怎样才能实现这个功能

- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath {
  return YES;
}


如果您只想将按钮的标题更改为“Cancel”,那么只需在表视图的委托中实现
-tableView:titleForDeleteConfirmationButtonErrorWatIndeXPath:
方法

-(NSString *)tableView:(UITableView *)tableView titleForDeleteConfirmationButtonForRowAtIndexPath:(NSIndexPath *)indexPath
{
    return @"Cancel";
}

您可能希望保留该功能,但显示不同的按钮。在这种情况下,滚动至投票率最高的答案,查看如何实现所需的操作。它可以工作SS:)谢谢@macserv
-(NSString *)tableView:(UITableView *)tableView titleForDeleteConfirmationButtonForRowAtIndexPath:(NSIndexPath *)indexPath
{
    return @"Cancel";
}