Question: I have created a storyboard with 12 buttons, 12 smaller buttons and 12 labels. 

It is like that:

```
btnBig1.tag = 1
btnSmall1.tag = 1
lbl1.tag = 1

btnBig2.tag = 2
btnSmall2.tag = 2
lbl2.tag = 2

```

etc...

Now when a procedure is called

```
- (IBAction)processButtonUpInside:(id)sender
{
     UIButton *nButton = (UIButton*)sender;
     int nInt =  nButton.tag;
}

```

... I would like to do something with all 3 controls (big button, small button and label).

It should look like this (pseudo-code):

```
- (IBAction)processButtonUpInside:(id)sender
{
     UIButton *nButton = (UIButton*)sender;
     int nInt =  nButton.tag;

     UIButton *nButtonBig (UIButton*)CastFromTagID(nInt)
     //do something with the big button

     UIButton *nButtonSmall (UIButton*)CastFromTagID(nInt)
     //do something with the small button

     UILabel *nLabel (UILabel*)CastFromTagID(nInt)
     //do something with the label

}

```

As you can see, the `CastFromTagID` is my "own invention". I don't know how I should actually do this. 

Can somebody help?
Thank you very much.

Answer: 
You can use 3 a different starting point for each button family:

```
enum {
    kTagFirstBigButton = 1000,
    kTagFirstSmallButton = 2000,
    kTagFirstLabel = 3000,
}

```

Assign the tags using them:

```
btnBig1.tag = kTagFirstBigButton + 1;
btnSmall1.tag = kTagFirstSmallButton + 1;
lbl1.tag = kTagFirstLabel + 1;

btnBig2.tag = kTagFirstBigButton + 2;
btnSmall2.tag = kTagFirstSmallButton + 2;
lbl2.tag = kTagFirstLabel + 2;
...

```

Now it's easy to find anything:

```
- (IBAction)processButtonUpInside:(id)sender
{
     UIButton *nButton = (UIButton*)sender;
     /* I'm not sure what button is `sender` here
        If it's a big or small one you can guess 
        comparing its tag with the first tag 
     */
     int offset =  nButton.tag;

     UIButton *nButtonBig = (UIButton*)[view viewWithTag:kTagFirstBigButton + offset];
     //do something with the big button

     UIButton *nButtonSmall = (UIButton*)[view viewWithTag:kTagFirstSmallButton + offset];
     //do something with the small button

     UILabel *nLabel = (UILabel*)[view viewWithTag:kTagFirstLabel + offset];
     //do something with the label
}

```
You shouldn't assign the same tag id to different views.

Indeed, do something like this:

```
btnBig1.tag = 11 btnSmall1.tag = 12 lbl1.tag = 13;
btnBig2.tag = 21 btnSmall2.tag = 22 lbl2.tag = 23;

```

Then consider the last digit of the tag id:

```
UIView *nView = (UIView *)sender;
if (lastDigit(sender.tag) == 3)
// this is a label 
{
    UIButton *nButtonBig = [nView.superview viewWithTag:nInt-2];
    UIButton *nButtonSmall = [nView.superview viewWithTag:nInt-1];
    UILabel *nLabel = (UILabel *)sender;
}
else if (lastDigit(sender.tag) == 2)
.....

```

where *lastDigit(sender.tag)* is a function that returns the last digit of a given integer.