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: im having trouble with the challenge

"Assume you have images named 'Robot1.png','Robot2.png','Robot3.png','Robot4.png', create an array of UIImage objects called 'robotImages'. " I would love to get tips on how to get the answer correctly. Thanks

7 Answers

NSArray*robotImages = [[NSArray alloc] initWithObjects:[UIImage imageName:@"Robot1.png"],[make another image object],[etc.], nil];

Wow, I have everything there except the bracket box from start and end. Thanks

I tried it and is still wrong.

Amit Bijlani when you get a chance please help me with this challenge.

My code:

robotImages = [[NSArray alloc] initWithObjects:[UIImage initWithImage:@"Robot1.png"],[UIImage initWithImage:@"Robot2.png"],[UIImage initWithImage:@"Robot3.png],[UIImage initWithImage:@"Robot4"], nil];

NSArray *robotImages = [[NSArray alloc] initWithObjects:[UIImage imageNamed:@"Robot1.png"], [UIImage imageNamed:@"Robot2.png"], [UIImage imageNamed:@"Robot3.png"], [UIImage imageNamed:@"Robot4.png"], nil];

I did that too and It was wrong.

I have just copied and pasted the code from my reply and it works :)