Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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

lordcozycat
lordcozycat
11,940 Points

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.

lordcozycat
lordcozycat
11,940 Points

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.