I have a working UIImageView, but I want to change it based on a certain variable so I have this:
a string called imagevariable(which holds the value of image1 which is a png resource in my project).
So I have this:
imageView.image = [UIImage imageWithContentsOfFile: [[NSBundle mainBundle] pathForResource:@"imagevariable" ofType:@"png"]];
But it doesn’t work. Can someone help?
By wrapping the variable name imagevariable in quotes it is being treated as a string literal, try this instead