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 trialVince Mease
7,544 PointsSetting a title quiz - bug?
This seems trivial and obvious so I'm thinking it's a bug in the quiz. It's the same exercise as presented in the PlaylistMasterViewController @IBOutlet, no?
class ViewController: UIViewController {
@IBOutlet weak var timerButton: UIButton!
var redColor: UIColor = UIColor.redColor()
override func viewDidLoad() {
super.viewDidLoad()
timerButton.setTitle("Start", forState: . Normal)
}
}
1 Answer
Nick Kohrn
36,940 PointsVince,
I just completed the challenge with this:
class ViewController: UIViewController {
@IBOutlet weak var timerButton: UIButton!
var redColor: UIColor = UIColor.redColor()
override func viewDidLoad() {
super.viewDidLoad()
//Add your code below
timerButton.setTitle("Start", forState: .Normal)
}
}
Looks like you have a space between your enum case for the second argument to the setTitle:forState:
method. You have . Normal
. Just remove the space and .Normal
should work for you.
Emmanuel Darmon
6,115 PointsI tried to get some help with the documentation, but cannot figure out where is this piece of code... Can you help me to help myself? :) Where can I find this in the documentation?
Vince Mease
7,544 PointsVince Mease
7,544 PointsForgot to mention that I get the following error:
"You need to use the
setTitle
method ontimerButton
."Additionally, if I remove the forState declaration, I get an error stating that I need to specify that. Beyond that, if I specify some other title besides, "Start", I get an error saying that I need to set the title to the correct string. That all leads me to believe that what I have above is correct and that the treeshouse quiz app is a little drunk.