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 Build a Simple iPhone App with Swift Views and View Controllers IBActions and IBOutlets

Alex Bruce
Alex Bruce
1,622 Points

What am I doing wrong here?

Can you please point out what I have to do... Thanks

random_quote.swift
class viewController: UIViewController {

    @IBOutlet weak var quoteLabel: UILabel!

    @IBAction func quoteButtonPressed() {
        quoteLable.text = "A stitch in time saves nine."
        //Your code here!
    }

}

1 Answer

You've misspelled quoteLabel

See here -

quoteLable.text = "A stitch in time saves nine."
Alex Bruce
Alex Bruce
1,622 Points

Thx bro I feel so stupid haha.

It happens all the time, even to the best of us! I find it good practice to look at all my variables and make sure they're correctly written out when I have an odd problem. Sometimes I can't find them so I'll walk away for a few minutes, come back, and I'll notice them almost instantly. Watch out for syntax errors as well.

Mind you, compilers (and even IDEs sometimes) will notify you of this sort of thing, by letting you know that the variable you just wrote doesn't exist. The code challenge isn't that robust because it doesn't have a compiler error section for Swift. If it did, this would be much easier to spot.

Alex Bruce
Alex Bruce
1,622 Points

Once again m8, thx.