This started to happen out of the blue. Any ideas: Code:
CUSTOMCLASSNAME (I have replaced the actual class name as it contains the name of the client.)
Initialising my tableView:
[self.tableView registerClass:[CUSTOMCLASSNAME class] forCellReuseIdentifier:[self reuseIdentifier]];
In cell for row:
Hi, the title is being printed in the console. This is my 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";
}
Return [cell contentView]
instead of cell
from tableView:viewForHeaderInSection:
EDIT: This somehow led to crashes on long-press gestures on UI Buttons. To fix that, I gave up and used another section with a single item as a fake section header.