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 Blog Reader iPhone App Rebuilding from Scratch Adding a Table View Controller Class

Tommy Choe
Tommy Choe
38,156 Points

Why self.title instead of _title

Why does Amit use a property instead of an instance variable. He assigns an array to self.title rather than _title.

I'm not entirely sure when to use either one.

1 Answer

Gabe Nadel
seal-mask
STAFF
.a{fill-rule:evenodd;}techdegree
Gabe Nadel
Treehouse Guest Teacher

So, often, you won't see any difference in how your app behaves, based on which you choose. However, it is changing how thing work behind the scenes and depending on if you implement customer setters/getters, KVO, etc...you could have different behaviors.

There is a great discussion of the difference here: http://stackoverflow.com/questions/10333495/difference-between-and-self-in-objective-c