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 trialBilly Chan
4,527 PointsHi there, I've been experiencing problems compiling my bit of code for the second part of this quiz.
I receive a "Bummer! Your code can't be compiled" error from the online compiler; however, when I preview the output, I see no errors. Furthermore, when I paste the block of code into an Xcode Playground, I also receive no error and everything compiles. What's going on?
import Foundation
let secondsSinceBirth = NSTimeInterval(1200000000)
var dateOfBirth = NSDate(timeIntervalSince1970: secondsSinceBirth)
let dateFormatter = NSDateFormatter()
dateFormatter.timeStyle = .ShortStyle
dateFormatter.dateStyle = .MediumStyle
var stringDate = dateFormatter.stringFromDate(dateOfBirth)
2 Answers
Myers Carpenter
6,421 PointsWe are working on a solution to this right now. We should it have in place in the next 2 hours. Sorry for the trouble.
Caleb Kleveter
Treehouse Moderator 37,862 PointsMost likely what happened is your code is fine but not exactly what the challenge is looking for. I'm sorry I can't help, I don't know Swift. I did find this post on the forum though.
Myers Carpenter
6,421 PointsMyers Carpenter
6,421 PointsThe fix is live. Happy learning!
Billy Chan
4,527 PointsBilly Chan
4,527 PointsGreat! Just tested this and can confirm everything is fixed. Thank you!