title: How to set button tag and cell tag similar in iphone sdk
body: <p>I have a table containing labels and buttons.on that button i have generated drop down list . i want to set cell tag and button tag similar. b'cos according to that i have to maintain my function. for your reference following image ll give you idea </p>
  
  <p><img src="https://i.stack.imgur.com/mrEUn.png" alt="As per image, Suppose consider i am having 4 records means the &quot;indexpath.row&quot; for cell is 0-11 now i want to set my button tag and cell tag according following series 0 1 2 3 3 4 5 5 6 7 7 8 9 9 10 11 11  and so on b&#39;cos data records are dynamic. "></p>
  
  <p>This is my code in CellForRowAtIndexPath :-NSString *s;
      Var=0;</p>
  
  <pre><code>if(indexPath.row&lt;=2)
  {
    btn_click.tag=indexPath.row;
  
      s =[dict valueForKey:[NSString stringWithFormat:@"%d",indexPath.row]];
  }
  else
  {
      if (indexPath.row%3==0)
      {
          Var=(NSInteger)(indexPath.row/3);
  
      }
      else
      {
          Var=Var+1;
      }
  
      if(indexPath.row%3==0 &amp;&amp; Var==1)
      {       
  
          btn_click.tag=indexPath.row;
           s =[dict valueForKey:[NSString stringWithFormat:@"%d",indexPath.row]];
  
      }
  
      else 
      {
          if (Var&gt;1)
          {
              Var=1;
          }
          btn_click.tag=indexPath.row-Var;
          s =[dict valueForKey:[NSString stringWithFormat:@"%d",indexPath.row-Var]];
      }
  
  }
  NSLog(@"CELLTAGTag%d",btn_click.tag);  
  </code></pre>
  
  <p>}</p>
  
  <p>Thanks &amp; Regards,
  Priyanka.</p>