nsmutalbe select

来源:互联网 发布:wap淘宝流量来源安全吗 编辑:程序博客网 时间:2024/05/20 20:46

- (void) setEditing:(BOOL)editting animated:(BOOL)animated

{

    [self.tableViewsetEditing:edittinganimated:YES];

    [self.tableViewsetMultipleTouchEnabled:YES];

   // [self.tableView setEditing:editting animated:YES];

}


viewdidload()

  self.tableView.allowsSelectionDuringEditing =YES;

    self.tableView.allowsMultipleSelection =YES;

    self.tableView.allowsMultipleSelectionDuringEditing =YES;



//select all row

-(IBAction)selectAll:(id)sender

{


    UIButton *btn = (UIButton *)sender;

    if (btn.tag == 0) {

        for (int i =0; i<5; i++) {

            NSIndexPath *myindexPath = [NSIndexPathindexPathForRow:iinSection:0];

            [self.tableViewselectRowAtIndexPath:myindexPathanimated:YESscrollPosition:UITableViewScrollPositionNone];

        }

        btn.tag = 1;

    }else{

        for (int i =0; i<5; i++) {

            NSIndexPath *myindexPath = [NSIndexPathindexPathForRow:iinSection:0];

            [self.tableViewdeselectRowAtIndexPath:myindexPathanimated:YES];

            

        }

        btn.tag = 0;

        

    }


  

}


原创粉丝点击