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

Roulse Mutsigwa
PLUS
Roulse Mutsigwa
Courses Plus Student 774 Points

Challenge Task 3 in Inheritance

The question reads: Finally, we have a class named 'Bling' which needs to have a property called 'ruby'. Switch over to 'Bling.h' and add a property named 'ruby' that belongs to the class 'Ruby'.

my answer is:

@interface Bling : NSObject
@property ( nonatomic, strong) Ruby * ruby;
@end     

Its giving an error

Im sure this is the correct answer, could this be a bug on Treehouse's side?

4 Answers

Hey Roulse,

I completed the Inheritance exercises myself and had the same answer you have and everything passed smoothly. Then I went ahead and literally copied and pasted the answer you provided into the interface and it passed as well. So it has to be a bug or a glitch somewhere, have you tried opening a new tab or reopening the browser and starting it over?

Ken Alger
STAFF
Ken Alger
Treehouse Teacher

Roulse;

Welcome to Treehouse!

Remember, the syntax for a property definition is:

@property(attributes) Classname *variable;

It looks like you have a slight syntax error in your code, which should read like:

@property(nonatomic, strong) Ruby *ruby;

Happy coding,

Ken

Roulse Mutsigwa
PLUS
Roulse Mutsigwa
Courses Plus Student 774 Points

Hi Ken

Thanks for responding, appreciate your help. I have written my code as above but it still gives a syntax error.

Roulse Mutsigwa
PLUS
Roulse Mutsigwa
Courses Plus Student 774 Points

Hi

Thanks Wahid and Ken. It all turned out good in the end.