1
votes

I have a UITableView. I need to have spacing between the cells, so what I did is, that all the cells are sections and the space between is the section footer. Also I have a UISearchBar on top of the table data to search the data. Now there is one little bug.

I click on the SearchBar. When I do not do a search, but just click cancel directly is get weird lines in the main table view. See Picture 1 below.

When I do a search and scroll the search results and then click cancel the bug doesnt appear. When I do a search and do not scroll, but click cancel, the bug does appear.

Anyone has an idea where that might come from?

I tried to do setNeedsDisplay and reloadData when the cancelButton is clicked, but neither worked.

Here is the code for the section footers.

- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section        {
    return kZellenAbstand;
}
- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section {
    UIView* view = [[UIView alloc] init];

    view.backgroundColor = [UIColor whiteColor];

    return view;
}

Picture 1 http://img338.imageshack.us/img338/4877/iossimulatorbildschirmf.png

1
I have narrowed it down. If I comment out view.backgroundColor = [UIColor whiteColor]; the bug does not appear, but the background of the table view, is visible, which it shouldn't be.Quelk
actually, the bug still appears, just isn't visible du to the standard clearColor background. However, I figured out, that the bug appears to be triggered by the disappearing Keyboard in some cases. The disappearing keyboard for some reason triggers viewForFooterInSection on sections 3 - 6.Quelk

1 Answers

2
votes

I figured out a workaround, at least for my scenario.

Since I only use the footers to have spacing between the cells, I just switched to the headers for that.

As for the issue itself, I issued a bug report with Apple. I'll post here, if I have additional information from that.