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 trialAndrew Oliver
3,687 PointsHow do I declare the variable planck NSNumber with the value 6.626!!?
I've tried everything I can think of!!
4 Answers
Stone Preston
42,016 Pointsyou need to use NSNumber literals. to assign an NSNumber literal you use the following syntax
NSNumber *someNumber = @25;
so to assign a literal to planck you would use:
NSNumber *planck = @6.626;
Rebecca Wei
596 PointsIt took me forever to get this as well!! It will actually only accept the second way it showed to assign the value from the previous video, the first and third ways don't work.
Ian Nebbiolo
2,031 PointsJust had the same problem spent 5 minutes trying to workout why it didn't like my syntax before finding this forum post. Thank you :)
Ivan Kvyatkovskiy
5,743 PointsNSNumber *planck = [[NSNumber alloc] initWithFloat:6.626];
Andrew Oliver
3,687 PointsThanks but that's what I did and it's still telling me it's wrong.
Ivan Kvyatkovskiy
5,743 PointsSeems like that Code Challenge wants some specific syntax from you that was presented in previous videos. Check them out and retry.