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

From Structs to Objects, do not understand implementation.

On the Structs to Objects video at 5:25 there is something going on aboiut creating an implementation. The code in the video changes from @interface to @implemenation and not sure why. What did the presenter do to turn it into an @implementation? Also in my sphere.h the #import line reads <Foundation/foundation.h> on the video it reads #import <Sphere.h>.

Would you be able to help me out with this?

Thanks.

2 Answers

Joe Li
Joe Li
8,104 Points

Hey Simon,

In the video he actually changes from working on Sphere.h to Sphere.m, without saying so, which was confusing. But for some reason the file he's working on shows Sphere.h but he was actually working in Sphere.m.

Hope that helps.

Joe

The @interface is from the header file (.h) and the @implementation is from the implementation file (.m).

He probably switches from the .h to the .m

I don't fully understand your other question.