Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

iOS Object-Oriented Swift 2.0 Classes Classes with Custom Types

Classes.swift --> Can't figure out this code challenge

Phew... I'm confused. I can not figure out why this isn't working... The error it brings up is "Your class needs to contain the stored properties specified in the directions"

   struct Location {
    let latitude: Double
    let longitude: Double
}



class Business {
    let name: String
    let locatoin: Location

    init(name: String, location: Location) {
        self.name = name
        self.locatoin = location
    }

}
let someBusiness = Business(name: "Not So Lucky", location: Location(latitude: 10.0, longitude: 22.0))

Does anyone have any ideas or can help point me in the right direction? I still don't fully understand init and I assume thats where the problem is - but I can't wrap my brain around it. What am I missing!?!

Thanks!

1 Answer

Nathan Tallack
Nathan Tallack
22,159 Points

You are going to kick yourself. ;)

You spelt location wrong in your stored property and your init. ;)

Wow... Yeah, thats rough. I spent so long trying different things and probably further confusing myself... Lesson learned.

Thanks for taking the time!