iphone - tableview cell checkmark disable when scroll -
when scroll tabview cell ,then checkmark hidden.what do?
- (void)tableview:(uitableview *)tableview didselectrowatindexpath:(nsindexpath *)indexpath { [[tableview cellforrowatindexpath:indexpath] setselected:no]; facebookfriend *friend = [self.fbfriendsfiltered objectatindex:indexpath.row]; // build list invite if ( [self.fbfriendsinvited containsobject:friend.fid] ) { [self.fbfriendsinvited removeobject:friend.fid]; nslog(@"fbfriendsinvited:%@",self.fbfriendsinvited); [[tableview cellforrowatindexpath:indexpath] setaccessorytype:uitableviewcellaccessorynone]; } else { //if ( [self.fbfriendsinvited count] >= kselectionlimit ) // return; [self.fbfriendsinvited addobject:friend.fid]; [[tableview cellforrowatindexpath:indexpath] setaccessorytype:uitableviewcellaccessorycheckmark]; nslog(@"fbfriendsinvited:%@",self.fbfriendsinvited); } }
you have add conditional check in cellforrowatindexpath:
set checkmark cell checked. keep array/set of nsindexpath
s of selected cells , check against it.
Comments
Post a Comment