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]; }

  • 相关阅读:
    模块二:操作系统windows 7 的使用
    茶卡盐湖
    css元素居中指南
    新的CMS套站
    写响应式页面
    积累
    jquery方法整理
    积累 做网站添加的 所有动态效果
    产品中心有二级三级栏目。
    aspcms
  • 原文地址:https://www.cnblogs.com/lidongxiao/p/4950021.html
Copyright © 2011-2022 走看看