I study iPhone development and created a simple application with an image that changes to another image when you click on it.
If I build it on a simulator, it works fine, but if I build it on a device, images will not appear. I feel that they are not being copied. I checked that they were correctly named, and I made sure that I imported them into "resources"
I donβt think this is a problem with the code, because I added a thing so that the text also appears when the image is playing, and this works, so the button is still doing something there, it just doesnβt have an image on it.
-(IBAction)changeImage:(id)sender { [fortuneCookieButton setImage:[UIImage imageNamed:@"Image2.jpg"] forState:UIControlStateNormal]; label.hidden = NO; } -(IBAction)restoreImage:(id)sender { [fortuneCookieButton setImage:[UIImage imageNamed:@"Image1.jpg"] forState:UIControlStateNormal]; label.hidden = YES; }
source share