Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

iOS

Image Based Animation Challenge #3

"Instruct your 'imageView' to start running the animation."

What's wrong? I Can't pass this challenge and I can not find an answer in the forum.

#import "THViewController.h"

@implementation THViewController

  • (void)viewDidLoad { [super viewDidLoad]; [self.imageView startAnimation];

self.imageView.animationImages = [[NSArray alloc] initWithObjects: [UIImage imageNamed:@"01"], [UIImage imageNamed:@"02"], [UIImage imageNamed:@"03"], nil];

self.imageView.animationDuration = 5.0f;

}

@end

Solved It. Put animation code in the wrong area.

import "THViewController.h"

@implementation THViewController

(void)viewDidLoad { [super viewDidLoad];

self.imageView.animationImages = [[NSArray alloc] initWithObjects: [UIImage imageNamed:@"01"], [UIImage imageNamed:@"02"], [UIImage imageNamed:@"03"], nil];

self.imageView.animationDuration = 5.0f; [self.imageView startAnimation];

2 Answers

the answer is [self.imageView startAnimating]; just have to fix Animation for Animating.