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 Inheritance

Caleb Kleveter
MOD
Caleb Kleveter
Treehouse Moderator 37,862 Points

I can,t figure out whats wrong with my code.

Whats wrong with my code? I'm geting a bummer sign that says: Don't forget to add '@end' and make sure' Ruby' sub-classes 'Gem'.

@class Gem;

@interface Ruby : NSObject @property (nonatomic, strong) Gem *shape; @end

Which Task are you getting this error on? Are you sure you've placed the correct code into the correct files?

4 Answers

Remember that you can specify a superclass with the : symbol. Right now, you have NSObject as the superclass of Ruby. The task is asking you to make Ruby the subclass of Gem, which is the same thing as saying that Gem is the superclass of Ruby.

See below:

@interface Ruby : Gem
@end
Caleb Kleveter
MOD
Caleb Kleveter
Treehouse Moderator 37,862 Points

I am having issues on task 2 in Ruby.h, and yes it is the right file.

Follow Kristen's answer for this :) In your original post, it seems you are also a bit ahead of yourself with the @property declaration. Task 2 will only require what Kristen has detailed.

Caleb Kleveter
MOD
Caleb Kleveter
Treehouse Moderator 37,862 Points

I did what you said and I got this message: Bummer! Don't forget to add '@end' and make sure 'Ruby' subclasses 'Gem'. But whats wired is that I did put in the @end.