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) Refactoring into a Model Understanding @property

_ vs. self

in the -(NSArray *) predictions method we use 'predictions' to get the predictions instance variable. However, in the -(NSString *) randomPredictions method we use 'self.predictions' to get the count. I'm confused on when I'm suppose to use '' vs. 'self.'

1 Answer

Hi Joaquin,

I would write out an explanation, but there is a very detailed answer on Stack Overflow that just might answer your question:

http://stackoverflow.com/questions/10333495/difference-between-and-self-in-objective-c

Happy coding! Shani