title: Find UIButton in Tableview header and change button title
body: <p>I have two-section headers and each header has UIButton, When I tap that UIButtons in header one popup will be opened. It has two buttons YES and NO. When user clicked the YES option in that popup I want to show YES title in the Header button. 
  Ex: If the user tapped on Section 1 header button popup will be opened and the selected Yes. I want to display that Y$S text in my Section 1 header button tile. </p>
  
  <p>My code :</p>
  
  <pre><code>-(UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
  if (section == 0) {
  
      UIView *view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, tableView.frame.size.width, 40)];
           view.backgroundColor = [UIColor whiteColor];
  
           UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(20, 10, tableView.frame.size.width-40, 21)];
           label.textAlignment = NSTextAlignmentLeft;
  
           label.font = [UIFont fontWithName:kAppFontLight size:12];
           label.textColor = [UIColor LSBlackColor];
           NSString *string = NSLocalizedString(@"Button1", nil);
           label.text = string;
           UIView *line = [[UIView alloc] initWithFrame:CGRectMake(0, 48, tableView.frame.size.width, 1)];
           line.backgroundColor = [UIColor groupTableViewBackgroundColor];
   operate = [[UIButton alloc] initWithFrame:CGRectMake(tableView.frame.size.width - 100, 6, 100, 30)];
   [operate setTitle:@"Button1" forState:UIControlStateNormal];
   [operate setTitleColor:[UIColor colorWithRed: 65/255.0 green: 190/255.0 blue: 236/255.0 alpha:1] forState:UIControlStateNormal];
   operate.titleLabel.font = [UIFont fontWithName:kAppFontRegular size:14];
   operate.tag = 10;
   [operate addTarget:self action:@selector(operateAction:) forControlEvents:UIControlEventTouchUpInside];
  
           [view addSubview:label];
           [view addSubview:line];
           [view addSubview:operate];
           return view;
  }
  else if (section == 1) {
   UIView *view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, tableView.frame.size.width, 40)];
           view.backgroundColor = [UIColor whiteColor];
  
           UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(20, 10, tableView.frame.size.width-40, 21)];
           label.textAlignment = NSTextAlignmentLeft;
  
           label.font = [UIFont fontWithName:kAppFontLight size:12];
           label.textColor = [UIColor LSBlackColor];
           NSString *string = NSLocalizedString(@"Button1", nil);
           label.text = string;
   UIView *line = [[UIView alloc] initWithFrame:CGRectMake(0, 48, tableView.frame.size.width, 1)];
      line.backgroundColor = [UIColor groupTableViewBackgroundColor];
      operateandEdit = [[UIButton alloc] initWithFrame:CGRectMake(tableView.frame.size.width - 120, 6, 100, 30)];
      [operateandEdit setTitle:@"Button2" forState:UIControlStateNormal];
      [operateandEdit setTitleColor:[UIColor colorWithRed: 65/255.0 green: 190/255.0 blue: 236/255.0 alpha:1] forState:UIControlStateNormal];
      operateandEdit.titleLabel.font = [UIFont fontWithName:kAppFontRegular size:14];
      operateandEdit.tag = 11;
      [operateandEdit addTarget:self action:@selector(operateAction:) forControlEvents:UIControlEventTouchUpInside];
  
           [view addSubview:label];
           [view addSubview:line];
           [view addSubview:operateandEdit];
           return view;
  }
  return nil;
  }
  </code></pre>
  
  <p>In operation action: </p>
  
  <pre><code>-(void) operateAction:(id) sender {
  if (operate.tag == 10) {
      if (sender.tag == 5) {
          [operate setTitle:@"YES" forState:UIControlStateNormal];
      } else {
          [operate setTitle:@"NO" forState:UIControlStateNormal];
      }
  } else {
      if (sender.tag == 5) {
          [operateandEdit setTitle:@"YES" forState:UIControlStateNormal];
      } else {
          [operateandEdit setTitle:@"NO" forState:UIControlStateNormal];
      }
  }
  [self cancelButtonClicked:@""];
  NSLog(@"%@", sender.currentTitle);
  }
  </code></pre>