zoukankan      html  css  js  c++  java
  • iOS开发之UITableViewController重写

     # UITablViewController方法的使用介绍


    - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { // 返回单元格数 }
    - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
    {
        // 返回表视图行数
    }
    - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
    {
      // 返回每个单元格
    }

    - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
    {
       // 选中单元格操作
    }

    #pragma mark - EditMode
    - (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath
    {
      // 返回可以编辑
        return YES;
    }

    - (UITableViewCellEditingStyle)tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath
    {  // 返回删除样式
        return UITableViewCellEditingStyleDelete;
    }

    -(NSString *)tableView:(UITableView *)tableView titleForDeleteConfirmationButtonForRowAtIndexPath:(NSIndexPath *)indexPath {
      // 返回删除 标题
        return @"删除";
    }

    -(void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath
    {
       // 删除执行操作
    }
     
  • 相关阅读:
    【MongoDB】windows平台搭建Mongo数据库复制集(相似集群)(一)
    关于jave在oracle驱动下事务提交与回滚问题
    将其它图片格式转为.eps格式
    学习OpenBlas
    ZOJ3640-Help Me Escape
    向死而生——我修的死亡学分
    iOS对象属性详解
    http状态码介绍
    8080端口被占用
    图片特效
  • 原文地址:https://www.cnblogs.com/ht-927/p/4283449.html
Copyright © 2011-2022 走看看