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) Foundation Framework NSString

Asimo Barmea
Asimo Barmea
2,553 Points

Are variables the same thing as objects in Obj C? Is there no difference between a variable and object?

Is there no difference between a variable and an object?

2 Answers

Jason Wayne
Jason Wayne
11,688 Points

@Asimo Barmea - Basically, most components in OOP are objects. Variable is also an object. I must have misunderstood your question, but my answer above is explaining object and variable separately. Hope I didn't cause any confusion.

Jason Wayne
Jason Wayne
11,688 Points

It's actually 2 separate things all together.

Variable is basically a value that can be altered depending on the info passed to it.

Object on the other hand is a concept. Object oriented programming a.k.a OOP refers to type of programming language that revolves around objects and data rather than action and logic.

Asimo Barmea
Asimo Barmea
2,553 Points

But in the videos it seems like these two words are being used interchangeably