This is caused by a subtle but important change that Apple has made in the behavior of the UITableView for section headers and footers. If you implement the tableView: viewForHeaderInSection: or tableView: viewForFooterInSection: delegate method, then you MUST also implement the tableView: heightForHeaderInSection: and tableView: heightForFooterInSection: delegate methods.
The additional header of the empty section that you see is called by returning "nil" from the methods "... viewFor ...", but does not return 0 from the methods "... heightFor ...".
source share