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

Introduction to objective-c

Hello everyone,

I cannot seem to get passes the 3rd stage of the challenge for this section. 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'.

they give you

  1. @interface bling : NSObject 2.
  2. @end 4.

I have ried many things but can't seem to work it out! any help would be much appreciated :)

1 Answer

Ben Falk
Ben Falk
3,167 Points

Hopefully this helps get you started...

  • You need to add an @property to Bling.h
  • Remember that for most properties (unless you have something specific that would change this), you need to set nonatomic and strong
  • You need to create "ruby", which belongs to the class "Ruby"
  • Remember the *, since you are creating a pointer to an object

The format looks something like this:

@property (nonatomic, strong) Class *name;