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
    {
       // 删除执行操作
    }
     
  • 相关阅读:
    【c++】龟兔赛跑问题
    【2016.3.21】关于字符串的一点总结
    程序员面试宝典(第五版)里的错误
    团队作业_总结_RTCSD2017
    团队作业_一周二周_RTCSD2017
    第三次作业_RTCSD2017
    第二次作业_RTCSD
    分析Demo1闪灯例程里的main.c
    第一次作业_RTCSD2017
    约束与自由
  • 原文地址:https://www.cnblogs.com/ht-927/p/4283449.html
Copyright © 2011-2022 走看看