-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
staticNSString *contactlistcellid =@"InviteJoinListViewCellidentifier";
InviteJoinListViewCell *cell = [tableViewdequeueReusableCellWithIdentifier:contactlistcellid];
if (cell ==nil) {
cell = [[InviteJoinListViewCellalloc]initWithStyle:UITableViewCellStyleDefaultreuseIdentifier:contactlistcellid];
cell.selectionStyle =UITableViewCellSelectionStyleNone;
UITapGestureRecognizer * tap = [[UITapGestureRecognizeralloc]initWithTarget:selfaction:@selector(cellSelectBtnClicked:)];
cell.contentView.userInteractionEnabled =YES;
[cell.contentViewaddGestureRecognizer:tap];
}
AddressBook *book = [self.localAddressBook[self.allAddressKeys[indexPath.section]]objectAtIndex:indexPath.row];
cell.portraitImg.image = book.head;
cell.nameLabel.text = book.name;
cell.numberLabel.text = book.phones.allValues.firstObject;
cell.selecImage.tag =indexPath.row+1000;
//判断selectedArray里面有没有当前这个数据
if ([_selectedArraycontainsObject:book]) {
cell.selecImage.image = [UIImageimageNamed:@"select_account_list_checked"];
}
else{
cell.selecImage.image = [UIImageimageNamed:@"select_account_list_unchecked"];
}
return cell;
}
/** 获取 tableview 的可见的所有 cell 但是复用时候会有问题*/
NSArray * cells = [tableView visibleCells];