views:

83

answers:

1

This is the strangest error i have come across.

Am trying to add a countdown animation onto a Class that extends UIView. The code is shown below:

NSArray *myImages = [[NSArray alloc] initWithObjects: [UIImage imageNamed:@"3.png"], [UIImage imageNamed:@"2.png"], [UIImage imageNamed:@"1.png"], [UIImage imageNamed:@"Go.png"], nil]; 
UIImageView *myAnimatedView = [[UIImageView alloc] initWithFrame:CGRectMake(50, 50, 80, 80)]; 
myAnimatedView.animationImages = myImages; 
myAnimatedView.animationDuration = 3; 
myAnimatedView.animationRepeatCount = 0; 
[self addSubview:myAnimatedView]; 
[myAnimatedView startAnimating];

It is just not appearing on the screen. Any Ideas?

+1  A: 

Have you made sure those images are added to your project?

Can you add them as a flat image (non-animated) -- as in:

UIImageView *myAnimatedView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"3.png"]];
[self addSubview:myAnimatedView];

(just to make sure that works first)?

If, instead of extending UIView, you extended UIImageView, would that make a difference?

Jeffrey Berthiaume