Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/102.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 如何更改tableviewcell删除确认按钮的提示字符串_Ios_Objective C_Swift - Fatal编程技术网

Ios 如何更改tableviewcell删除确认按钮的提示字符串

Ios 如何更改tableviewcell删除确认按钮的提示字符串,ios,objective-c,swift,Ios,Objective C,Swift,当我想删除一个单元格时,我只想更改TableViewCell的确认按钮标题,但在引用中找不到任何相关属性。 我只想把标题从删除改为垃圾,有人知道怎么做吗 重写UITableViewDelegate的现有方法 -(NSString *)tableView:(UITableView *)tableView titleForDeleteConfirmationButtonForRowAtIndexPath:(NSIndexPath *)indexPath { return @"trash";

当我想删除一个单元格时,我只想更改
TableViewCell
的确认按钮标题,但在引用中找不到任何相关属性。
我只想把标题从删除改为垃圾,有人知道怎么做吗

重写UITableViewDelegate的现有方法

-(NSString *)tableView:(UITableView *)tableView titleForDeleteConfirmationButtonForRowAtIndexPath:(NSIndexPath *)indexPath {
    return @"trash";
}
目标-C

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

func tableView(tableView: UITableView, titleForDeleteConfirmationButtonForRowAtIndexPath indexPath:NSIndexPath) -> String
{ 
      return "Trash"; 
}

希望这对您有所帮助

谢谢,现在我知道我应该在UITableViewDelegate中找到文档,而不是在table视图中。是的,它只是忘了键入