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

code challenge problem

Hi guys , i am not sure where i am doing wrong. refering to this link: http://teamtreehouse.com/library/image-based-animation-2

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'.

the code which i have written is: NSArray *array=[[NSArray alloc] intiWithObjects:[UIImage imageNamed:@"01.png"],[UIImage imageNamed:@"02.png"],[UIImage imageNamed:@"03.png"],nil]; self.imageView.animationImages= array;

would appreciate if you could tell me where am i going wrong. Thanks.

2 Answers

everything needs to be stated in 1 statement. You almost got it right ! Your line of code should be :

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

Thanks Natacha , It works fine now!!!!!!