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
Mark McCuller
3,539 PointsFrom Structs to Objects
Objective-C Basics / Introduction to Objective-C / From Structs to Objects
In the video Mr. Turner is coding in the header file (Sphere.h) he copies and pastes code from timeline 5:24 with blue highlight for the getter and setter methods but when we get to timeline 5:26 two seconds later where did the other code changes come from in the header file? timeline 5:24
#import <Foundation/ Foundation.h>
@interface Sphere : NSObject
VS timeline 5:26
#import “Sphere.h”
@implementation Sphere
Thanks for the help on really understanding Objective-C, Mark M.
2 Answers
SP Rieland
2,573 PointsYes, second that. Wasted a lot of time trying to figure out what he did. Very frustrating. We start the lesson looking at the navigator bar on the left, but he seems to use some keyboard shortcut to switch files which appears near the top of the Xcode environment, while the Sphere.h file remains highlighted in the left navigation bar. Treehouse staff, can you please change this video to make it clearer.
Mark McCuller
3,539 PointsI figured it out. The blue highlight for file shown in Navigator tree side does not show if he is in the .h or .m of Sphere in Xcode in the video. I thought he was in the header file for both timelines, but he transitioned to the .m at the timeline 5:26. I will make a note of this detail.
Thanks, Mark M.
Sean Sassenrath
1,950 PointsI got hung up on this too - wasted a lot of time trying to figure it out. Needs to be more clear.
John W
21,558 PointsJohn W
21,558 Points(Edited for code block markdown)
First code block is from the header .h file, second code block is from the implementation .m file. So yes, two separate files.