This is probably an easy one but I want to hide variably named UI elements in a loop:
int i = intFigures + 1;
while (i <= 16) {
imagei.hidden = TRUE;
i++
}
Essentially I need to display a number of images between 1 and 16 depending on the record. If that particular record only has 12 images, I want to hide UIImage 13 through 16. How do I set the UIImage that I am trying to hide based on the increment of the loop?
You cannot just append the variable i to the name of the image variable. You probably already have your ImageViews in an array, why not just iterate over that.
Alternatively, if your imageViews are added directly to your current view, you could just iterate over its subviews. When you add the images, you could give certain imageViews a specific tag so that you can later identify them. Such as: