sorry for the simple question but how do you make a CAlayers using a for loop?
I have this now but what is the proper way of doing this?
for (int n = 1; n <= 6; n++) {
NSString *theCloud = [NSString stringWithFormat:@"cloudImage%d",n];
NSString *theCloudLayer = [NSString stringWithFormat:@"cloudLayer%d",n];
CALayer *theCloudLayer = theCloud.layer;
}
any help is appreciated.
Use an NSArray or NSMutableArray, not a bunch of variables with numbers at the end of their names (also known as a Poor Man’s Array).
So that would be something like: