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 Object-Oriented Swift 2.0 Class Inheritance Creating a Subclass

Ivan Belmonte
Ivan Belmonte
2,073 Points

Potential bug found

Hello there,

I think the init declaration on the Vehicle class is buggy. It expects the argumets "withDoors" and "withWheels" instead of the Vehicle attributes "numberOfDoors" and "numberOfWheels". My code couldn't be compiled until I changed this line to match the object attribute names.

Best regards, Ivan

Konrad Krรณl
Konrad Krรณl
4,454 Points

Hi there, everything is OK with this initializer. "withDoors" and "withWheels" are only external names(you see them while creating an instance of Vehicle class) for parameters: "doors" and "wheels".

Ivan Belmonte
Ivan Belmonte
2,073 Points

Yes you're right. Sorry I'm a newbie, thank you for clarifying :-D

1 Answer

Aurelian Spodarec
Aurelian Spodarec
10,801 Points

Don't worry! Every person, or most, that's new and can't solve a challenge, usually write here on potentially finding a bug :D