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 Inheritance Convenience Initializers

Lorenzo Acosta
PLUS
Lorenzo Acosta
Courses Plus Student 2,761 Points

Could not find an overload for 'init' that accepts the supplied arguments

When i'm writing the convenience initializer from the example, i get the following mistake: "Could not find an overload for 'init' that accepts the supplied arguments"

This is the code

    convenience init (title: String) {
        self.init (title:title,price:99,designer:"Calvin Klein")
    }

As you can see it's the same than Amit's so i don't understand the error.

I will appreciate the help. Thanks in advance!

2 Answers

Lorenzo Acosta
PLUS
Lorenzo Acosta
Courses Plus Student 2,761 Points

I just realize that i put that convenience init inside the Product class, instead of the Clothing Class. Sorry to waste your time answering me. Thanks a lot for the help!

Ha! That would do it, yes!! Well spotted! :-)

Yep - looks right! Can you post your init function please? Maybe the error is inside that.

Steve.