Q:

UIImageView animations not working

I'm trying to use UIImageView to animate a lamp switching on and off. I have two images, one with a glow and the other without. This should be very simple and I'm sure I've done this before with no problem, yet my code just isn't working. Here's what I have:
UIImage *glow = [UIImage imageNamed:@"Glow.png"];
UIImage *noGlow = [UIImage imageNamed:@"No Glow.png"];
NSArray *images = [NSArray arrayWithObjects:noGlow, glow, nil];

self.lampImage.animationImages = images;
self.lampImage.animationDuration = 1.0;

[self.lampImage startAnimating];

NSLog(@"%d", self.lampImage.isAnimating); // prints 1 
NSLog(@"%d", self.lampImage.animationRepeatCount); // prints 0

At the moment I have this code in my viewDidLoad. If I run the app with the above code, all I see is the NoGlow image. If I swap the order in the images array (glow, noGlow, nil) and run the app again, I just see the Glow image instead.
According to the logs, it is animating and the repeat count is 0, meaning it should keep animating indefinitely. Why am I not seeing any animation?
I'm testing this in the iOS 5.1 and 6.1 simulator with the same results for both.

A:

Maybe your error is the different name of your file or image name.
Try to rename the file No Glow.png with No_Glow.png for don't fall in error

