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 trialWojciech Pilwinski
1,723 PointsBummer! Make sure you're adding a stored property to your subclass as specified in the directions
OK, it's again me :) so could you help me and tell me what wrong I do now. I stored property blueColor to the class ViewController, and gave it default value UIColor.blueColor(). "Preview" doesn't show any errors. So why can't I pass that challenge?
For any help, thanks in advance. Best Regards
class ViewController: UIViewController {
var blueColor: UIColor = UIColor.blueColor()
override func viewDidLoad() {
// Do any additional setup after loading the view, typically from a nib.
}
override func didReceiveMemoryWarning() {
// Dispose of any resources that can be recreated
}
}
2 Answers
jcorum
71,830 PointsWow! I can't believe they would do something like this! You work is fine. The editor is just insisting on a constant rather than a variable (without any hint to that effect):
let blueColor = UIColor.blueColor()
Pavel Bogart
1,713 Pointsthe same error
sometimes it's quite annoying when you are coding in Xcode and everything is alright but when paste in to website field it doesn't work.
Curtis Bridges
17,720 Points// this works!
let blueColor = UIColor.blueColor()
is the correct answer, which threw me off as well -- although the error doesn't say it, the instructor must be looking for the constant (let) version of a stored property rather than the variable (var) version:
// doesn't pass the check
var blueColor = UIColor.blueColor()