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

Caleb Kleveter
Caleb Kleveter
Treehouse Moderator 37,862 Points

What should I do about the sub-class?

Mr. Turner said in this video to name the sub class in the new file you make "Shapes" but in the version i'm using (5.1.1) they give you 3 options to choose from and you can't name your own . what do I do?

2 Answers

I'm using the same version. Right click the project folder and select "New File.." and then select "Objective=C class" from the iOS section. Click next, and in the first field, call it "Button" or whatever shape you're making. In the second field, type in "Shape" because Button will be a sub class of Shape.

Click next and create, and you're all set.

1st field would be Class Name 2nd field would be which class it inherits from (i.e. what subclass it is of)