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

J Smillie
PLUS
J Smillie
Courses Plus Student 40,123 Points

Can't work out what I need to do to alloc and init for this question

For our final task, we need to display the image we just created and to do that we’re going to use a UIImageView instance. Allocate and initialize the userProfilePhoto property to use the profileImage we created. Hint: You can either use the initWithImage: method or the image property of the UIImageView.

This is Task 3 of the Managing Playlist Data part of the Create a Simple Playlist App Course for iOS.

Can anyone help?

3 Answers

Hi Jonathan, I'm not sure what the instructions are for the task but I think this is the code you want:

 _userProfilePhoto = [[UIImageView alloc] initWithImage:_profileImage];

Hey Jonathan, can you post a link to the code challenge and specify if it is Swift or Obj-C?

J Smillie
PLUS
J Smillie
Courses Plus Student 40,123 Points

Hi Caleb. Thanks for responding!

It is task 3 and it is part of the Objective-C for iOS course.

Any help would be greatly appreciated!

http://teamtreehouse.com/library/build-a-playlist-browser-with-objectivec/managing-playlist-data/creating-uiimageviews