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 trialAlex Cevallos
16,551 PointsDifference between instance variables in implementation or interface
Hey at 2:48 in the video, we begin to add an instance variable.. but we are declaring it in the implementation file. I was wondering if there were any benefits to declaring the instance in .m over declaring the instance variable in the .h header file
thanks in advance!
1 Answer
Patrick Serrano
13,834 PointsI believe that when you declare the instance variable in the implementation file that you're declaring it "privately". The .h file from my understanding describes the "public" parts, while the .m contains "private" parts
Alex Cevallos
16,551 PointsAlex Cevallos
16,551 PointsThe second video in the blog reader app confirmed this.. thank you, you are correct
Alex Cevallos
16,551 PointsAlex Cevallos
16,551 PointsAccidental second comment