Question

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.

Was it helpful?

Solution

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!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top