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

Edwin Mhoy Silva Rifa
Edwin Mhoy Silva Rifa
2,631 Points

IBAction challenge

What Iยดm i doing woung?

random_quote.swift
class viewController: UIViewController {

    @IBOutlet weak var quoteLabel: UILabel!

    @IBAction func quoteButtonPressed() {
       quoteLabel.text = "A stitch in time saves nine"
    }

}

1 Answer

Daniel Johnson
Daniel Johnson
104,132 Points

You're doing it right. You just forgot the period at the end of the sentence. I think they need to provide better error messages for some of these challenges. The error message on this challenge tells you to set the text attribute on quoteLabel even if you're doing it correctly just with the wrong text.

I know it's a little silly that it will not let you pass the challenge because of that, but you would be surprised how many times one little mistake can break an entire app. However, a mistake like this would probably not break your app, but you might want to use copy and paste from now on in the challenges.

random_quote.swift
class viewController: UIViewController {

    @IBOutlet weak var quoteLabel: UILabel!

    @IBAction func quoteButtonPressed() {
        quoteLabel.text = "A stitch in time saves nine."
    }

}