Create an NSArray ivar that you can add all UILabel to.
If you do this in code, then when creating a UILabel just do
NSMutableArray *labels = [[NSMutableArray alloc] init]; // Repeat this for al labels UILabel *label = [[UILabel alloc] in... [labels addObject:label]; // Then self.labels = [labels copy];
If you are using IB, declare your property as follows
@property (nonatomic, strong) IBOutletCollection(UILabel) NSArray *labels;
and connect all the tags before that.
Paul.s
source share