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
Arsene Lavaux
4,342 PointsInstagram avatar in Photo app
Working on the extra credit of Photo Bombers app.
Is there a way to use the avatarForPhoto method that Amit added to THPhotoController to get the avatar on the THDetailViewController?
Pretty sure there is, it's got to be pretty similar to what imageForPhoto is doing for the main image but I am struggling with the syntax.
Help to a beginner, like myself, would be welcome.
Merci! :) Arsène
P.S: I tried to do this in the setPhoto method of MetaDataView: https://www.dropbox.com/s/5td81y8v64shkuf/avatarForPhoto.png
And, it didn't work. Hope non-beginners can give me a hand on this.
3 Answers
Stone Preston
42,016 Pointstry using
self.imageView.image = image
instead of self.imageView = image. that should solve the incompatible type warning you are getting. what error are you getting for the method call? its not visible in the screen shot
Arsene Lavaux
4,342 PointsHi Stone - See what I get for the error on method call: https://www.dropbox.com/s/ao88penpa47r4fj/no_class_method_avatarForPhoto.png
I provided more details here, just in case it's helpful: https://teamtreehouse.com/forum/qq-on-instagram-photo-bombers-app
Arsene Lavaux
4,342 PointsI actually did:
[THPhotoController avatarForPhoto:self.photo completion:^(UIImage *image) {
self.avatarImageView.image = image;
}];
And it seems to be working.