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 trialHarry Tran
10,618 PointsrawValue or hashValue?
My xCode playground is not accepting .rawValue in my daysTillWeekend function, but rather when gives me the option of a hashValue when I start typing. It seems to return the correct answer when I put in Day.Friday into the function the answer comes back as 1.
But the code breaks if I use .rawValue
2 Answers
Rob Randell
13,809 PointsTry .toRaw() so Day.Saturday.toRaw() returns 6.
The .rawValue is all fine in Xcode 6.1 so you may need to update.
Harry Tran
10,618 PointsWonderful, thank you for helping me out Rob
Harry Tran
10,618 PointsHarry Tran
10,618 PointsLooks like it's an issue with my Xcode, I have version 6.0.1 and it doesn't appear that Apple used rawValue until 6.1