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 trialDavid Fry
13,267 PointsWhat 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
50,595 PointsHi 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
13,267 PointsI was referring to the first step. Thanks I will give it a try!
Holger Liesegang
50,595 PointsDavid Fry Like your motto "I want to learn something new everyday." :)