I have an NSTableView with multiple selections enabled
If I select items and scroll the list back and forth they are remember and shown and selected (blue background).
Using the didDeselectRowAtIndexPath and didSelectRowAtIndexPath I am able to keep my own array of selected items.
that part works well.
However If I then use the sectionForSectionIndexTitle and jump to a letter The selection appears to be forgotten even indexPathForSelectedRows appears to have been reset and is now empty.
My own array remembers that an item is selected and I can set the cell.selected in the cellForRowAtIndexPath but the instant I move the list it is forgotten again
Any ideas is this a bug or how do you retain the selection list when jumping to a letter
Thanks in advance
By using an
NSMutableArrayof selected row values, it may be possible to keep track of the selected rows in the table yourself. Then it would be a matter of calling-selectRowAtIndexPath:animatedon the last object in the array to restore the selections.As for the bug: what could possibly be happening when the table jumps to a selected letter, is a stray
-reloadDatawhich would forget the selected row(s).