내가 알다시피, 당신이 CellforseAtIndexPath에서 셀이 null인지 확인하지 않은 2 개의 실수를 저지르고 수신자 목록에 따라 셀에 대한 accessoryType를 설정합니다.
아래에서 좋아해야합니다.
NSString *CellIdentifier = @"cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
}
PFUser *user = [self getUserAtIndexPath:indexPath];
cell.textLabel.text = user.name;
if ([self.recipients containObject:user]) {
cell.accessoryType = UITableViewCellAccessoryCheckmark;
}
else {
cell.accessoryType = UITableViewCellAccessoryNone;
}
return cell;