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

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;