We are new to Xcode and are having a problem setting text labels with array values. The following works fine; the print command is only included to ensure that the array is working. All is good except we'd like to set the values using a for loop and array.
English0.text = animal0.animalName
Norwegian0.text = animal0.norwegianName
image0.image = UIImage(named: "animal\(animal0.animalNumber)")
print(animals[0])
Next we tried to use the array to set the English label, but the result was a crash due to line 01:
English0.text = animals[0].animalName
Norwegian0.text = animal0.norwegianName
image0.image = UIImage(named: "animal\(animal0.animalNumber)")
print(animals[0])
If we can get the labels to be set with the array values, then we'd like to proceed with a loop to set the 10 animals.
Any help you can provide is appreciated.
Thanks,
Mike