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

Challenge Problem iOS

Hi Guys,

Looking for help, the challenge is to:

Set the 'robotImages' to the animation images property of 'imageView'

My code:

================

UIImage *image = [UIImage imageNamed:@"robot.png"]; UIImageView *imageView = [[UIImageView alloc] initWithImage:image];

/* Write your code below this line */ NSArray *robotImages = [[NSArray alloc] initWithObjects:[UIImage imageNamed:@"Robot1"], [UIImage imageNamed:@"Robot2"], [UIImage imageNamed:@"Robot3"], [UIImage imageNamed:@"Robot4"], nil]; self.imageView.animationImages = robotImages;

==================

I know i probably completely missing something but not sure what. I guessing i can't just say " = robotImages"

Thanks in advance for your help,

Simon

2 Answers

Hi Simon,

I got similarly stuck earlier today, and found a useful discussion here: http://teamtreehouse.com/forum/set-the-robotimages-to-the-animation-images-property-of-imageview

Hope this helps, Natasha

Hi Natasha,

Thanks for the response. I figured it out just after having sent the message.

I keep placing self. into the code when it is not needed. Not exactly clear on when i need it and when i don't yet.

Thanks,

Simon