elimelec / inethack

Automatically exported from code.google.com/p/inethack
GNU General Public License v2.0
0 stars 0 forks source link

Multi-Selection menus are buggy re item selection (items sometimes lose the selection) #49

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Invoke any multi select menu, like (D)ropping several unpaid items
2. Might help if there are more items than can fit on the screen
3. Try so select them all, scroll a little

What is the expected output? What do you see instead?
Items seem to lose their selection on scrolling

Original issue reported on code.google.com by din...@gmail.com on 11 Aug 2009 at 11:10

GoogleCodeExporter commented 8 years ago
Probably due to table cell re-use, which is the correct thing to do. Ideally 
the selection would need to be cached 
in some structure of your choosing so that next time the cell is re-created on 
screen (ie- when you scroll back 
up) you can tell the cell it is "selected" already...

Original comment by kevinh...@gmail.com on 11 Aug 2009 at 11:15

GoogleCodeExporter commented 8 years ago
I see. I'm already saving selected state in own objects, but when cells get
(re-)initialized this is not reflected ...

Original comment by din...@gmail.com on 11 Aug 2009 at 11:58

GoogleCodeExporter commented 8 years ago
Can you go into the NethackMenuViewController.m  at 
- (UITableViewCell *)tableView:(UITableView *)tableView 
cellForRowAtIndexPath:(NSIndexPath *)indexPath {

and add:

cell.selected = i.isSelected;

right before you return the cell? I think that might do it...

Original comment by kevinh...@gmail.com on 11 Aug 2009 at 12:24

GoogleCodeExporter commented 8 years ago
already done in local version, haven't gotten to test it yet

Original comment by din...@gmail.com on 11 Aug 2009 at 12:33

GoogleCodeExporter commented 8 years ago
Cool, you might also need this: (?)

cell.accessoryType = i.isSelected ? 
UITableViewCellAccessoryCheckmark:UITableViewCellAccessoryNone;

Hope it works :)

Original comment by kevinh...@gmail.com on 11 Aug 2009 at 12:39

GoogleCodeExporter commented 8 years ago
r83

Original comment by din...@gmail.com on 11 Aug 2009 at 2:29