title: Alternative option of UIButton addTarget:action:forControlEvents: method in IOS
body: <p>I know that this question has been asked so many times but i want to pass a custom object as an argument on clicking a button.</p>
  
  <p><code>UIButton addTarget:action:forControlEvents:</code> doesn't allow us to do that but it is important for me so I can do further on the basis of custom objects.</p>
  
  <p>If an alternative for add target is possible, so please give the solution.</p>
  
  <p>The code is like this:</p>
  
  <p>Custom Object:</p>
  
  <pre><code>HeaderData *cell ;
  </code></pre>
  
  <p>Button:</p>
  
  <pre><code>_forward =[UIButton buttonWithType:UIButtonTypeRoundedRect];
  [_forward setTitle:@"F" forState:UIControlStateNormal];
  _forward.frame = CGRectMake(300, (_CELL_HEIGHT-_LABEL_HEIGHT)/2, 10 ,_LABEL_HEIGHT);]
  [_forward addTarget:web action:@selector(functionName:) forControlEvents:UIControlEventTouchUpInside]; 
  </code></pre>
  
  <p>and the function which is called on clicking the UIButton _forward is:</p>
  
  <pre><code>-(void)functionName:(UIButton *)sender{
      //code for further programming on the basis of cell.
  }
  </code></pre>