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 Build a Simple iPhone App (iOS7) Animating and Intercepting Events Image Based Animation

iOS Stage 6: Animating Images Task 1

Hey, I seem to be stuck on this code challenge. Not quite sure where I'm going wrong as this code runs ok in Xcode. I've tried using both '01.png' and '01'. Here is my current code:

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

I keep getting an error message when I click on 'Check Work'.

Any help would be appreciated :)

Thanks,

Tom

2 Answers

Stone Preston
Stone Preston
42,016 Points

you used a single quote instead of a double opening quote on your third image

here is your code:

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

here is the code with the fixed quotation mark

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

Thanks! Only spotted it once I had posted it on here.

Sorry - already spotted what was wrong!

03 was written '03" instead of "03"

Thanks,

Tom