ios - TableView deselectRowAtIndexPath does not call setHighlighted -
ios - TableView deselectRowAtIndexPath does not call setHighlighted -
i'm trying alter states of label in table view cell. want maintain cell selected while force different view controller , move view controller tableview. when select row want remove highlight of selected row's lable (deselect selected row) , highlight current row's label. - (void)deselectrowatindexpath:(nsindexpath *)indexpath animated:(bool)animated
supposed phone call - (void)sethighlighted:(bool)highlighted animated:(bool)animated
highlighted 'no' cell ? note: i'm not uitableviewcontroller.
keep cell selected:
-(void)tableview:(uitableview *)tableview didselectrowatindexpath:(nsindexpath *)indexpath { uitableviewcell *cell = [tableview cellforrowatindexpath:indexpath]; cell.selected = yes; //other code }
ensure class cell don't have selected = none in interface builder.
unselect lastly row:
- (nsindexpath *)tableview:(uitableview *)tableview willselectrowatindexpath:(nsindexpath *)indexpath { nsindexpath *currentselectedindexpath = [tableview indexpathforselectedrow]; if (currentselectedindexpath) { uitableviewcell *cell = [tableview cellforrowatindexpath:indexpath]; cell.selected = no; } homecoming indexpath; }
ios uitableview
Comments
Post a Comment