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 trialSpencer Cook
4,823 PointsiOS NSNumber Challenge
I don't understand why this code is not correct in creating a variable called planck and setting its value to 6.626. The code excutes just fine in Xcode.
NSNumber *foxtrot;
foxtrot = [[NSNumber alloc] initWithInt: 24];
NSLog(@"foxtrot %@", foxtrot);
NSNumber *planck = [NSNumber numberWithFloat:6.626];
2 Answers
Amit Bijlani
Treehouse Guest TeacherGlad you figured it out!
Jonas Simkus
10,814 PointsOmg, tried all correct ways to make it work and it kept telling me that I'm doing it wrong. You should FIX it, cause if not this forum, you can't pass such a simple step.
Corey Leveen
3,301 PointsI agree. This challenge is terrible
Spencer Cook
4,823 PointsSpencer Cook
4,823 PointsI realized the answer. The above code is correct but the challange wants you to use different syntax like below:
NSNumber *foxtrot = @24; NSLog(@"foxtrot %@", foxtrot);
NSNumber *planck = @6.626; NSLog(@"planck %@", planck);