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

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..

@interface Gem : NSObject

@interface Ruby : Gem

@interface Bling : NSObject


1 Answer

Caleb Kleveter
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!