UITableView with multiple selections

Posted by NewDev on Stack Overflow See other posts from Stack Overflow or by NewDev
Published on 2012-06-13T03:43:53Z Indexed on 2012/06/13 4:40 UTC
Read the original article Hit count: 151

I have a UITableView with multiple selections enabled.

If I select items and scroll the list back and forth they are remembered 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?

© Stack Overflow or respective owner

Related posts about iphone

Related posts about ios