So i have a bunch of dynamically loaded labels..
Each of them has the same name because there is no telling how many there will be..
I have another method (not t
Okay since you dont have any code to show i guess i have to speculate.
What i understood is that you are creating Dynamic UILabels
in ur code and you want to access them. Since you have same name for all the UILabels
you might me loosing the previous UILabel
when every time you create a new UILabel
. So in order to keep track of how many UILabel
you created you must add them in an Array. Declare an NSMutableArray
in your viewController.h
file and make sure in the viewDidLoad
u allocate it like
arrForLabels = [[NSMutableArray alloc]init];
Since it is an NSMutableArray
you can add object to it.
So when u create a UILabel
make sure you add the same UILabel
in the Array as well
for Instance
[arrForLabels addObject:yourLabel];
you can try to NSLog
your Array to see its content.
Now all youu got to do is to Create a weak link like that
UILabel *tempLabel = [arrForLabels objectAtIndex:1];
now tempLabel
will be the UILabel
to change text
tempLabel.text = @"My New Text";
It will work fine. Feel free to ask for any issues in it.