Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

iOS Object-Oriented Objective-C Diving Deeper - Classes, Properties and Methods Methods in Practice

What is `self`? I'm having a hard time wrapping my head around it

Where is the "click below" part to get more information about self?

2 Answers

Nathan Barnes
Nathan Barnes
Courses Plus Student 13,996 Points

Remember that the 'self' keyword means the instance acting on itself, so when you create an object and call a method that uses the self keyword within its body, then the actions within that method will be applied to the object calling the method.

Hope that clears it up.

Akash Sharma
Akash Sharma
Full Stack JavaScript Techdegree Student 14,147 Points

You can make multiple instances of the class like table2, table3 .. tableN. so for each tableN the class methods knows its talking about the table its calling the method from not just table3.