title: How to use Tag on dynamic button in IOS?
body: <p>I have created buttons by using for loop. The buttons are made perfectly fine. Now I have to single IB action for all of the dynamic buttons. I have set tag too.The code I am using is below written. But the action is not identifying the exact button which I want to use.</p>
  
  <pre><code>for (int i=0; i &lt; 10; i++){
  
       btnphoto=[[UIButton alloc]initWithFrame:CGRectMake(10,(30*i)+110,50,20)];
  
       [btnphoto setTitle:@"Photo" forState:UIControlStateNormal];
  
       [btnphoto addTarget:self action:@selector(someMethod:)forControlEvents:UIControlEventTouchUpInside];
  
       btnphoto.tag=100 + i;
  
       [self.view addSubview:btnphoto];
  
  }
  
  -(void)someMethod:(UIButton *)sender{
  
  }
  </code></pre>