I am trying to use a UITableview
with multiple selection on and a check mark accessory view for selected rows. This is mostly working if I turn on and off the accessory view in tableView:didSelectRow
.
However, I tried to build a selectAll
method, and I found that the array of selected cells was being cleared after I had spun through all the cells and selected them if I then call reloadData()
.
I suspect reloading the table clears selection. I don't know of any other way to have all the cells drawn after I set the selected flag and accessory view.
I am wondering if I need to keep my own array of selected rows. Has anyone else built something like this? Its seems like a common scenario.
Any tips or sample code appreciated.