title: UITableView custom section header appears below the cells
body: <p>I've a custom section header in my UITableView and I can't figure out why they are appearing bellow the UITableViewCell of the table. See the screenshots:</p>
  
  <p><img src="https://i.stack.imgur.com/HZpYj.png" alt="UITableViewCell are above the section header"></p>
  
  <p>This is the code that creates the section header:</p>
  
  <pre><code>- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
      NSString *sectionTitle = [self tableView:tableView titleForHeaderInSection:section];
      if (sectionTitle == nil) {
          return nil;
      }
  
      return [LojaInfoHeaderView lojaInfoHeaderForSection:section withTitle:sectionTitle opened:[self sectionIsOpen:section] andDelegate:self];
  }
  - (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {
      return [LojaInfoHeaderView viewHeight];
  }
  </code></pre>
  
  <p>And the section's cell are inserted or deleted when the user touches the section header:</p>
  
  <pre><code>- (void)lojaInfoHeader:(LojaInfoHeaderView *)lojaInfoHeader sectionDidOpen:(NSInteger)section {
      NSArray *indexPathsToInsert = [self indexPathsForSection:section];
      [self setSection:section open:YES];
      [_tableView insertRowsAtIndexPaths:indexPathsToInsert withRowAnimation:UITableViewRowAnimationTop];
  }
  
  - (void)lojaInfoHeader:(LojaInfoHeaderView *)lojaInfoHeader sectionDidClose:(NSInteger)section {
      NSArray *indexPathsToDelete = [self indexPathsForSection:section];
      [self setSection:section open:NO];
      [_tableView deleteRowsAtIndexPaths:indexPathsToDelete withRowAnimation:UITableViewRowAnimationTop];    
  }
  </code></pre>
  
  <p>How can I make the section header appears above the cells? How to fix it?</p>
  
  <p><strong>Update to show how things are created</strong></p>
  
  <p>These are the class methods I'm using:</p>
  
  <pre><code>+ (CGFloat)viewHeight {
      return 44.0;
  }
  
  + (LojaInfoHeaderView *)lojaInfoHeaderForSection:(NSInteger)section withTitle:(NSString *)title opened:(BOOL)isOpen andDelegate:(id&lt;LojaInfoHeaderDelegate&gt;)delegate {
      LojaInfoHeaderView *newHeader = [[[LojaInfoHeaderView alloc] initWithFrame:CGRectMake(0, 0, 320, 44)] autorelease];
      newHeader.section = section;
      [newHeader setTitle:title];
      newHeader.delegate = delegate;
      [newHeader setOpen:isOpen animated:NO];
      return newHeader;
  }
  </code></pre>