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 Build a Simple iPhone App (iOS7) Animating and Intercepting Events Adding Sound

Difference 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
Patrick Serrano
13,834 Points

I 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

The second video in the blog reader app confirmed this.. thank you, you are correct

Accidental second comment