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 nsindexpaths of selected cells , check against it.


Comments

Popular posts from this blog

java - nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet Hibernate+SpringMVC -

sql - Postgresql tables exists, but getting "relation does not exist" when querying -

asp.net mvc - breakpoint on javascript in CSHTML? -