zoukankan      html  css  js  c++  java
  • UItableView 编辑

    - (NSString *)tableView:(UITableView *)tableView titleForDeleteConfirmationButtonForRowAtIndexPath:(NSIndexPath *)indexPath
    {
        return @"删除";
    }
    
    - (UITableViewCellEditingStyle)tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath
    {
        return UITableViewCellEditingStyleDelete;
    }
    
    - (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath
    {
        debugMethod();
        NSLog(@"%ld,%ld", indexPath.section, indexPath.row);
        if (editingStyle == UITableViewCellEditingStyleDelete) {
            //移除数据源的数据
            NSMutableArray *mutableArr = [self.goodsListArray mutableCopy];
            [mutableArr removeObjectAtIndex:indexPath.row];
            self.goodsListArray = [mutableArr copy];
            [tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationLeft];//移除tableView中的数据
        }
    }
  • 相关阅读:
    浏览器版本过低
    虚拟PWN初探
    elasticsearch常用查询
    python安装pip模块
    spark-kafka-es交互 优化
    scala写文件
    python unittest
    scala collection(集合)
    spark-kafka-es交互
    scala语法
  • 原文地址:https://www.cnblogs.com/apem/p/4391729.html
Copyright © 2011-2022 走看看