Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/100.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 如何在特定单元格中禁用编辑模式?_Ios_Ios6_Uitableview - Fatal编程技术网

Ios 如何在特定单元格中禁用编辑模式?

Ios 如何在特定单元格中禁用编辑模式?,ios,ios6,uitableview,Ios,Ios6,Uitableview,我在可编辑模式下创建了tableview所有tableview行都包含(-)符号,但我需要一些单元格不在可编辑模式下,如果可能的话, 根据UtableViewDataSource的苹果文档,谢谢 您可以使用tableView:canEditRowAtIndexPath:是阅读将有助于了解此问题。有问题的方法将帮助您:tableView:canEditRowAtIndexPath: 这会让你朝着正确的方向前进 - (BOOL)tableView:(UITableView *)tableView

我在可编辑模式下创建了tableview所有tableview行都包含(-)符号,但我需要一些单元格不在可编辑模式下,如果可能的话,
根据UtableViewDataSource的苹果文档,谢谢

您可以使用
tableView:canEditRowAtIndexPath:

是阅读将有助于了解此问题。有问题的方法将帮助您:
tableView:canEditRowAtIndexPath:

这会让你朝着正确的方向前进

- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath {

    BOOL edit = NO;

    if(indexPath.row == 2) {

        edit = YES;
    }

    return edit;
}

请查看
Tableview编程指南
,并快速查看
UITableViewDataSource
UITableViewDelegate
参考资料。应该很明显哪些方法是合适的!干杯:)在Swift中它的-func tableView(tableView:UITableView,canEditRowAt indexath:indexPath)->Bool{}