How to uncheck all rows using UITableViewCellAccessoryCheckmark

后端 未结 4 1329
栀梦
栀梦 2021-02-20 10:48

I\'ve got a UITableView with each row containing a checkbox using UITableViewCellAccessoryCheckmark. I can\'t figure out how to uncheck all the checkbo

4条回答
  •  庸人自扰
    2021-02-20 11:34

    for (UITableViewCell *cell in [myTableView visibleCells]) {
        cell.accessoryType = UITableViewCellAccessoryNone;
    }
    

    But really, you'd be better off just modifying the one cell that actually has the checkmark set. You have to have stored this information somewhere in your model anyway.

提交回复
热议问题