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

I am a bit confused when it comes to functions and properties

I hear all these things about functions an objects and properties so could someone please explain it to me? So we can access the functions using the dot syntax or what? Also, what is a method, object, function, property, etc... Also when we say types, do we mean strings, numbers(int, double, float) and booleans?

1 Answer

I hear all these things about functions an objects and properties so could someone please explain it to me? So we can access the functions using the dot syntax or what? <--- a property can be access by the dot syntax, which is usually what is always done like say you create "NSString *someString;" then you can in turn access it in the .m file like this "self.someString" and give it a value.

Also, what is a method, object, function, property, etc... <-- A method in objC would look like [[NSArray alloc]init]; here we are calling the alloc method and changing the init method to the "type"(or class) NSArray

Also when we say types, do we mean strings, numbers(int, double, float) and booleans? <-- Yes types and classes are used interchangeable