1

I have a simple but custom section header in which I am showing dynamic content in a label. However, when I pop a VC and in the active VC I run [self.quickDialogTableView reloadData] in viewWillAppear, the data is not being updated to the correct "self.sectionHeaderTitle. Any idea what I am doing wrong?

(void)sectionHeaderWillAppearForSection:(QSection *)section atIndex:(NSInteger)indexPath {
  if (indexPath == 0) {
  UIView *header = [[UIView alloc] initWithFrame:CGRectMake(0, 5, 320, 110)];
  header.backgroundColor = [UIColor clearColor];

  UIView *header_background = [[UIView alloc] initWithFrame:CGRectMake(25, 10, 270, 100)];
  header_background.backgroundColor = [UIColor whiteColor];

  UILabel *title = [[UILabel alloc] initWithFrame:CGRectMake(15, 0, 255, 25)];
  title.text = @"A sample static title";

  UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(55, 40, 200, 40)];
  label.text = self.sectionHeaderTitle;

  [header addSubview:header_background];
  [header_background addSubview:title];
  [header_background addSubview:label];
  [section setHeaderView:header];
}
mcardleliam
  • 158
  • 8

1 Answers1

0

Try reload the section, like this:

 [self.quickDialogTableView reloadSections:[NSIndexSet indexSetWithIndex:section] withRowAnimation:UITableViewRowAnimationBottom];
Sebastian
  • 6,154
  • 5
  • 33
  • 51