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 Blog Reader iPhone App Adapting Data for Display UITableViewCell with an Image

David Fry
David Fry
13,267 Points

What is wrong?

I am not sure why this is wrong and wont pass.

What is given: UITableViewCell cell = [[UITableViewCell alloc] init]; / Write your code below this line */

What I wrote: cell.imageView.image = [UIImage imageNamed:@"placeholder.png"];

2 Answers

Holger Liesegang
Holger Liesegang
50,595 Points

Hi David,

you might try

UIImage *image = [UIImage imageNamed:@"placeholder.png"];

for Challenge task 1 of 2 as the question states "Create an instance of UIImage called 'image' given the name of the image is 'placeholder.png'." and therefore wants you to create a complete new UIImage variable.

But

cell.imageView.image = [UIImage imageNamed:@"placeholder.png"];

is correct for Challenge task 2 of 2 "Add an image to the instance of UITableViewCell named 'cell' with the previously created 'image' object."

Did you delete the first step by mistake? Which step of the challenge are you referring to?

David Fry
David Fry
13,267 Points

I was referring to the first step. Thanks I will give it a try!

Holger Liesegang
Holger Liesegang
50,595 Points

David Fry Like your motto "I want to learn something new everyday." :)