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
Steve Smith
12,956 PointsIn Photobombers, sometimes you're adding @properties to the .m file, and sometimes to the .h file. Why is that?
For example, all the @property declarations are in the header file for THPhotoCell, but all are in the implementation file for THPhotosViewController. Should they not always be in the .h file?
3 Answers
rishavatreya
4,945 PointsDavid THIBAULT
4,423 PointsYes, in *.h -> public in *.m -> private
Steve Smith
12,956 PointsWhat I think is the reasoning here is that public @properties are added to the .h file, making those properties accessible from outside the class, and private @properties are added in the .m file making them only accessible from within the class itself.
Is that correct?