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

Aaron Yow
PLUS
Aaron Yow
Courses Plus Student 8,262 Points

i am abit confused here

i am not really sure what am i doing wrong

random_quote.swift
class viewController: UIViewController {

    @IBOutlet weak var quoteLabel: UILabel!

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

}

3 Answers

Jhoan Arango
Jhoan Arango
14,575 Points

Hey Aaron Yow , I've modified my answer since I've noticed something.

After coming back and re-evaluating your question, I went back to the challenge and tried it again.

As mentioned by Jay, the quoteLabel has a misspelling, but what I think what you were really missing ( since Im sure you tried several times ) it's the . at the end of the sentence.

class viewController: UIViewController {

    @IBOutlet weak var quoteLabel: UILabel!

    @IBAction func quoteButtonPressed() {
       quoteLabel.text = "A stitch in time saves nine." // Use the dot at the end of sentence. 
    }

}

I apologize for the wrong information before. This should allow you to continue with your challenges. Please let me know if it works.

Aaron Yow
Aaron Yow
Courses Plus Student 8,262 Points

i gave it another try but this comes up
Bummer! You need to set the text attribute on quoteLabel to "A stitch in time saves nine."

Jhoan Arango
Jhoan Arango
14,575 Points

Hi

Did you try it like this ?

class viewController: UIViewController {

    @IBOutlet weak var quoteLabel: UILabel!

    @IBAction func quoteButtonPressed() {
       quoteLabel.text = "A stitch in time saves nine." // Use the dot at the end of sentence. 
    }

}
Jay Guyll
Jay Guyll
3,261 Points

I guess I can't see all of the code so I am not sure I know what your issue is. From what I see, it looks like you might be calling the variable by the wrong name, "quoteLabel" is missing an "e" when used to assign it a string. Disregard if that is not your issue and best of luck!

Aaron Yow
PLUS
Aaron Yow
Courses Plus Student 8,262 Points

its working now out of no where thanks for the help guys :D