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

Mark McCuller
Mark McCuller
3,539 Points

Simple iPhone App (iOS7)

Build a Simple iPhone App (iOS7) / Animating and Intercepting Events / Image Based Animation / Code Challange:

I am stuck on this code challange and could you any help. Question 1 of 3 (Let's add animation to the Random Quotes app. A property named 'imageView' has been already defined. Assuming you have images named '01.png','02.png','03.png', create an array of UIImage objects and assign them to the 'animationImages' property of 'imageView'.) My code is:

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

Thank you for the help, Mark

3 Answers

Hey Mark,

It's a simple mistake to make but you're error lies here:

self.backgroundImageView.animationImage

In the app that Treehouse is getting you to build, the name of your UIImageView is "backgroundImageView". In the code challenge, the name of your UIImageView is in fact "imageView". Change this and you should be good to go!

:)

Mark McCuller
Mark McCuller
3,539 Points

Steve,

I still am not passing part 1 of 3 in code challenge. I corrected code below from your comments. Thank you for the help.

Mark

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

Emmanuel Guerlesquin
Emmanuel Guerlesquin
3,536 Points

Hey Mark,

You might passed this challenge by now but this post hasn't been answered.

The mistake is in the name of the images: @"01" should be replaced by @"01.png" @"02" should be replaced by @"02.png" @"03" should be replaced by @"03.png"

Code:

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