title: Add button in tableview footer
body: <p>I have tableview in one viewcontroller. I have one section in that. I want to add button in footer. I have written this code but footer view is not displaying.</p>
  
  <pre><code>- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section{
  
      UIView *footerView=[[UIView alloc]initWithFrame:CGRectMake(0, 0, 320, 40)];
      UIButton *addcharity=[UIButton buttonWithType:UIButtonTypeCustom];
      [addcharity setTitle:@"Add to other" forState:UIControlStateNormal];
      [addcharity addTarget:self action:@selector(addCharity:) forControlEvents:UIControlEventTouchUpInside];
      addcharity.frame=CGRectMake(0, 0, 40, 30);
      [footerView addSubview:addcharity];
      return footerView;
  
  }
  </code></pre>
  
  <p>I have also set height of footer 100 in its delegate method.</p>
  
  <p>screenshots:
  Initially i have 3 data. But when I search for particular data and result will be displayed in tableview at that time I have one data so at that time footer location changed. I want to to fix footer at initial place.
  <img src="https://i.stack.imgur.com/OOq9a.png" alt="enter image description here"></p>
  
  <p><img src="https://i.stack.imgur.com/MEe1r.png" alt="enter image description here"></p>
  
  <p><strong>Edit:</strong></p>
  
  <p>As an alternative solution one can add button by adding extra cell at the end.</p>