views:

59

answers:

1

Hi everybody!

After detecting Button sender through its tag in an action method, I want to dynamically assign some text to the corresponding Label (say, button tag+10 ) using some sort of temp UILabel var.

Hoping that's understandable?..english is not my native language :)

thank you.

+1  A: 

In the containing view, you can use viewWithTag to get the object with a specific tag.

If you know the object is a UILabel, you can typecast it to get your label object.

If you are in your viewcontroller.m file:

UILabel* myLabel;

myLabel = (UILabel*)[self.view viewWithTag:(buttonTag+10)];

Good luck!

Rob
Swiftly and sharply answered. Working already. Thank you Rob.
BigJoke
Glad to help. Stack Overflow gives me extra points if you mark this answer as your accepted answer. Just click the checkmark to the left of the answer. Thanks!
Rob