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

I dont understand why my answer is wrong

Inside Ruby.h i typed :

@interface Ruby : Gem @property(nonatomic) float ruby

//please create a variable under Ruby called ruby

@end

Inside Bling.h i typed :

@interface Bling : Gem Ruby *ruby=[Ruby alloc] init]; // Please create a variable called ruby and assign it the same structure as Ruby//

@end

What is wrong ?

How does the sub class matter? I ve rewatched the videos 2 - 3 times but i still haven't made out the differences in classes. Yes the button shapes and circle rectangle analogy i understand. But i don't understand how the variables created in shape are linked to the variables created in buttons. And what does the linking do compared to no linking. Its not explained with the code.

Gem.h
@interface Gem : NSObject 
@end
Ruby.h
@interface Ruby : Gem 
@property(nonatomic) float ruby
@end
Bling.h
@interface Bling : NSObject
Ruby *ruby = [[Ruby alloc] init];
@end

What does this relate to? WHat videos are you referring to? What are the exact questions and initial contents of the files?

It's ios

1 Answer

Hi this is the Question :

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

OK, please link the challenge and maybe the related video. Since it's iOS-related, I moved it to iOS section and cannot help you further with this question, since I have no knowledge whatsoever about iOS development.