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 PointsQq on Instagram Photo Bombers app
Would value the community expertise on the following related to the extra credit of the Photo Bombers app.
In THPhotoController.m, two class methods were created by Amit, using the same downloadURL method, to set the main image and the avatar in the DetailViewController.
See: https://www.dropbox.com/s/bfjsecj4evakqs4/THPhotoController_imageForPhoto_avatarForPhoto.png
THPhotoController.h is imported in THMetaDataView.m which should allow to call either of these methods.
THMetaDataView.m does recognize imageForPhoto, see my screen as I call the method: https://www.dropbox.com/s/v9uihq32z2ofv9a/imageForPhoto_Method_recognized_THMetadataView.png
However, when I do the same thing on avatarForPhoto, THMetaDataView doesn't recognize it. See my screen when attempting to call avatarForPhoto: https://www.dropbox.com/s/lm5wvk25ohr94ft/avatarForPhoto_not_recognized_THMetadataView.png
Why?
Any ideas would be welcome. I am a beginner iOS developer.
Thanks/Merci/Grazie/Gracias
:) Arsene
2 Answers
Stone Preston
42,016 Pointsis the avatarForPhoto method declared in the header file of THPhotoController? if its not, that could be the issue. Double check and make sure the method is declared in the header, if not, add it to the header file.
In order for your detailViewController to know what methods the THPhotoController class has, those methods must be declared in THPhotoController header file
Arsene Lavaux
4,342 PointsDuh... You are the best Stone.
I didn't have a declaration of the class method in the header. I no longer have the error messages now.
Thank you very much :)
Stone Preston
42,016 Pointsglad it was a simple fix : )