这开始突然发生。任何想法:代码:
CUSTOMCLASSNAME(我已经替换了实际的类名,因为它包含客户端的名称。)
初始化我的 tableView:
[self.tableView registerClass:[CUSTOMCLASSNAME class] forCellReuseIdentifier:[self reuseIdentifier]];
在行的单元格中:
嗨,标题正在控制台中打印。这是我的 cellForRow:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
AVTCheckListTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:[self reuseIdentifier] forIndexPath:indexPath];
[self configureCell:cell atIndexPath:indexPath];
return cell;
}
- (void)configureCell:(AVTCheckListTableViewCell *)cell atIndexPath:(NSIndexPath *)indexPath {
ChecklistGroup *group = [self.checklistFetchedResultsController.fetchedObjects objectAtIndex:indexPath.section];
ChecklistItem *item = [self getChecklistItemForIndexPath:indexPath];
[cell setSelectionStyle:UITableViewCellSelectionStyleNone];
[[cell cellTextView] setAttributedText:[[item checked] boolValue] ? [[NSAttributedString alloc] initWithString:[item name] attributes:@{ NSStrikethroughStyleAttributeName : @(NSUnderlineStyleSingle) } ] : [[NSAttributedString alloc] initWithString:[item name]]];
[[cell cellTextView] setUserInteractionEnabled:[[group isUserDefined] boolValue]];
[[cell cellTextView] setTag:indexPath.row];
[[cell cellTextView] setDelegate:self];
[[cell tickImage] setHidden:![[item checked] boolValue]];
}
//Method that returns re-use:
- (NSString *) reuseIdentifier {
return @"CheckListTableView";
}