Is it possible to accept a button tag to be in some range iphone sdk

Posted by neha on Stack Overflow See other posts from Stack Overflow or by neha
Published on 2010-05-07T13:06:34Z Indexed on 2010/05/07 13:08 UTC
Read the original article Hit count: 303

Hi all,

In my application I'm doing dynamic resizing of cells and label in it depending upon the text in it. I'm adding button to cells in uitableview.

I'm taking the label instance and button instance in a new label and button variable respectively and setting their frames to arrange them properly after resizing.

     if(cel==nil)
     {
       //some code
       original_label=[[UILabel alloc]init];
       original_label.tag=111;

       //SOME MORE CODE GOES HERE

       original_button=[[UIButton alloc]init];
       original_button.tag=222;
       //SOME MORE CODE GOES HERE
     }

      new_label=(UILabel *) [cell viewWithTag:111];    //This' how I'm taking the label instance on cell and below button instance on cell in new variables
      new_button = (UIButton * ) [cell viewWithTag:222];

Earlier I kept the tags of all the buttons on cells same, so it was easier to get button instances on cells properly and were being arranged properly. But now I want to recognize these buttons separately as I'm adding some functionality on button_click. I'm giving the buttons that are added to the cells incremental tags[1,2,3...9 and so on]. Now, how can I take these button tags in some range like[suppose 1-9]?

Can anybody help?

Thanks in advance.

© Stack Overflow or respective owner

Related posts about iphone

Related posts about iphone-sdk