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 Objective-C Basics (Retired) Introduction to Objective-C From Structs to Objects

Why is everything a pointer in Object-oriented programming ?

Around 6:30, Mr Turner says everything is a pointer in object-oriented programming. Why is that ?

2 Answers

Antoine,

In computer science, a pointer is a programming language object, whose value refers to (or "points to") another value stored elsewhere in the computer memory using its address. A pointer references a location in memory, and obtaining the value stored at that location is known as dereferencing the pointer.

Check out this course from Team Treehouse

I hope that helps.

Thanks Aaron. I'm following the whole course on ObjectiveC Basics so I watched and understood the one on pointers. What I don't understand is why in ObjectiveC (as opposed to C) we suddenly use pointers for everything, or as Mr Turner says in the video : "everything is a pointer" (with no further explanation).

I'd wager a guess - it's because it was the most straightforward way to implement objects on top of C.

I'm guessing it has to do with handling memory when creating applications. Just a way to make running them a bitter better and easier on the developer. Also, he mentions that Obj-C scales well in comparison to C. Maybe pointers are a factor. Again, these are just ideas. I'd like to know as well, though.