As the question asked I want to know if there is a possibility to change property’s trough the int of a for loop.
example:
controller.h:
@property (weak, nonatomic) IBOutlet UILabel *lblTeamName1;
@property (weak, nonatomic) IBOutlet UILabel *lblTeamName2;
@property (weak, nonatomic) IBOutlet UILabel *lblTeamName3;
controller.m
@synthesize property lblTeamName1;
@synthesize property lblTeamName2;
@synthesize property lblTeamName3;
for(int i = 0;i <= 3;i++)
{
lblTeamName(i).text = @"something";
}
What I am asking is a way for this to work, I have no idea if this will work or if this can’t be done.
You could do something like this…
This would rely on having a standard naming convention for your labels.
Oh, also, just a note. You no longer need to put @synthesize. If you’re using Xcode 4.5 then they removed the need for using @synthesize. The compiler infers it if it is left out.