zoukankan      html  css  js  c++  java
  • tableView里删除单元格

    tableView里删除单元格

    -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
    {

    staticNSString*reuse =@"reuse";

    DetaileCell*cell = [tableView dequeueReusableHeaderFooterViewWithIden tifier:reuse];

    if(!cell ) {
    cell = [[DetaileCellalloc]

    initWithStyle:UITableViewCellStyleDefau lt reuseIdentifier:reuse];

    cell.model= [self.subArray objectAtIndex:indexPath.row];

    }

    return cell; }

    -(void)tableView:(UITableView
    *)tableView
    didSelectRowAtIndexPath:(NSIndexPath
    *)indexPath
    
    {
        NSLog(@"shan");
    

    UIAlertView*alerV = [[UIAlertView alloc] initWithTitle:@"是否删除" message:nil delegate:self cancelButtonTitle:@"确定" otherButtonTitles:@"取消", nil];

    alerV.tag= indexPath.row;

    [alerV show]; }

    - (void)alertView:(UIAlertView
    *)alertView
    clickedButtonAtIndex:(NSInteger)buttonI
    ndex
    

    {
    if(buttonIndex ==0) {

    NSLog(@"确定");

    Model*model = self.subArray[alertView.tag];

    [DB deleteModel:model.time];

            [self.subArray
    removeObjectAtIndex:alertView.tag];
    

    [self.taleV reloadData]; }

  • 相关阅读:
    Oracle SQL Developer 设置自动提示(完成设置)
    访问控制修饰符
    BigDecimal.valueOf
    Use try-with-resources
    python学习之字符编码
    python语法:
    python学习之环境搭建 输入输出
    C51存储的优化
    c51中的bit,SBIT
    关于IO模拟时序(SPI)的注意事项
  • 原文地址:https://www.cnblogs.com/lidongxiao/p/4950021.html
Copyright © 2011-2022 走看看