I have a problem with some headers that are repeating on the screen. It seems to appear when I click in a textView in a TableViewCell, it scrolls automatically to put the cell in the middle of the screen, and I write in it during all that process. The header "repeated" can be in the footer, or anywhere else for info.
Here is the code:
- (NSString *)tableView:(__unused UITableView *)tableView titleForHeaderInSection:(NSInteger)index //HEADER
{
return [[self sectionAtIndex:index].header description];
}
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
{
UILabel *myLabel = [[UILabel alloc] init];
myLabel.frame = CGRectMake(12, 0, tableView.frame.size.width, 25);
myLabel.font = sectionFont;
myLabel.textColor = sectionColor;
myLabel.backgroundColor = colorSegment;
myLabel.text = [self tableView:tableView titleForHeaderInSection:section];
UIView *headerView = [[UIView alloc] init];
[headerView addSubview:myLabel];
return headerView;
}