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 trialarnavthecoder
3,453 PointsHow 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
@end
@interface Ruby : Gem
@end
@interface Bling : NSObject
@end
1 Answer
Caleb Kleveter
Treehouse Moderator 37,862 PointsThe 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.
arnavthecoder
3,453 Pointsarnavthecoder
3,453 PointsThank you so much Caleb Kleveter!