I have UIImageViews image1, image2, image3 etc.
I have the filenames for the images to go in them in an array called imageFiles. (The images change during the program, so I can’t preload them.)
Can I use a loop to load the image filenames into the series of images? (I know the code for setting an image into a specific imageView, but can I create an array of UIImageViews and load the filename at index 1 of the imageFiles array into image1, the file at index 2 into image2, and so on?
I’m new to Objective C, learning from books, websites, and tutorials as fast as I can.
Edit: I found a partial solution and added it as an answer, but I need to access the array from other methods, like touchMove. I asked this in a subsequent question..
I have an answer to my own question, for anyone who is also looking for the same thing (but the solution leads to another problem!)
(To get the images from another array, replace the image name with
[filenameArray objectAtIndex[i]])But this method defined the
arrayOfImageslocally, and I need to access the array from other methods, liketouchMove.