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

How to write the property for ruby in bling.h code challenge

Hi all,

How do I write a property for ruby in bling.h. I gives me an error saying "Did you forget to add the ruby property?"

Thanks in advance..

Gem.h
@interface Gem : NSObject

@end
Ruby.h
@interface Ruby : Gem

@end
Bling.h
@interface Bling : NSObject





@end

1 Answer

Caleb Kleveter
MOD
Caleb Kleveter
Treehouse Moderator 37,862 Points

The code looks like this:

@property(nonatomic, strong) Ruby *ruby;

When you create a property you have @property(), filling in the parentheses with the proper arguments, then you have the name of the class that the property inherits from, then an star (or however you spell the other name for it), the name of the property then a semi-colon.

Thank you so much Caleb Kleveter!