Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The first block of code just deselects all of the selected rows. This isn't the solution to your problem. There are a few fundamental issues with your code in general that need correcting...</p> <p>First off -- you need to keep an array of the selected cells, indexed as the full (non-searching) table is indexed. For example, if there's text in the search bar and the first row is selected, your selected cell array should also indicate the selection boolean of the preceding and following rows not currently visible, and do so all in order.</p> <p>Secondly -- you need to explicitly set the checkmarks in your cells' accessory views during your cellForRowAtIndexPath: method in order to indicate your selected cells. The only reason that you have a checkmark in the first cell after the search bar is cleared and the table's reloaded is because the cell's being reused (i.e. [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath]).</p> <p>By fixing these first and second issues, you should be off to a good start... When you're not searching, the selected cell array should contain the appropriate selection booleans for all the cells in proper order; and when you are searching, you have to filter the selected cell array in just the same way you'd filter your table based on the search text. And instead of adding checkmarks during didSelectRowAtIndexPath:, you would be better off just indicating that the cell is selected in the selected cell array then reloading table to display the appropriate checkmark.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload