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 trial

iOS Objective-C Basics (Retired) Foundation Framework NSNumber

iOS 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];

I 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);

2 Answers

Omg, 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
Corey Leveen
3,301 Points

I agree. This challenge is terrible