I think the following code speaks for itself.
if (card==1) {
cardImageString = @"myGrabbedImage1.png";
} else if (card==2) {
cardImageString = @"myGrabbedImage2.png";
} else if (card==3) {
cardImageString = @"myGrabbedImage3.png";
} else if (card==4) {
cardImageString = @"myGrabbedImage4.png";
} else if (card==5) {
cardImageString = @"myGrabbedImage5.png";
} else if (card==6) {
cardImageString = @"myGrabbedImage6.png";
} else if (card==7) {
cardImageString = @"myGrabbedImage7.png";
} else if (card==8) {
cardImageString = @"myGrabbedImage8.png";
}
The actual if-else is 10 times bigger than this.
Card = int.
CardImageString = NSString.
'card' is only used in this statement and can be removed in your answer.
How can I simplify all this??? Thanks!!