title: iOS - Unable to call action from dynamically created button in UITableViewCell
body: <p>i have created two button programmatically in UITableView<br> i.e Edit Delete</p>
  
  <p>when we click the cell these buttons are displayed but when i try to click in <strong>edit or delete</strong> button it doesn't calls the appropriate method i.e edit or deleteBtn.<br>
  This is my code.</p>
  
  <pre><code>-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
      static NSString *CellIdentifier=@"Cell";
  
      UITableViewCell *cell=[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
  
      if(cell==nil){
          cell=[[[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier]autorelease];
      }
  
      NSString *cellValue=[firstName objectAtIndex:indexPath.row];
      cell.textLabel.text=cellValue;
  
  
      edit=[[UIButton alloc]init];
      [edit setTitle:@"Edit" forState:UIControlStateNormal];
      [edit setFrame:CGRectMake(100, 100, 100, 20)];
      [edit setTag:1];
      [edit addTarget:self action:@selector(edit) forControlEvents:UIControlEventTouchUpInside];
  
      delete=[[UIButton alloc]init];
      [delete setTitle:@"Delete" forState:UIControlStateNormal];
      [delete setFrame:CGRectMake(150, 100, 100, 20)];
      [delete setTag:2];
      [delete addTarget:self action:@selector(deleteBtn) forControlEvents:UIControlEventTouchUpInside];
  
      [cell.contentView addSubview:delete];
      [cell.contentView addSubview:edit];
  
      return cell;
  
  }
  </code></pre>
  
  <p>my edit and delete function are very simple</p>
  
  <pre><code>-(void)edit{
  
  NSLog("%@",selectedValue);
  }
  
  -(void)deleteBtn{
  
  NSLog("%@",selectedValue);
  }
  </code></pre>
  
  <p>i have checked this function applying breakpoint but it is not called.</p>
  
  <p>this is how my <strong>selectedValue</strong> comes</p>
  
  <pre><code>-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
  selectedValue=[firstName objectAtInder:indexPath.row];
  }
  </code></pre>
  
  <p>Thanks, in advance,<br>
  Arun.</p>