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

Andrew Visser
Andrew Visser
2,752 Points

Can't understand why this is not correct

Hey guys,

On this code challenge I cannot understand what is wrong with my code. When using this code is compiles and returns the expected value. In the challenge it says this is incorrect.

NSNumber *foxtrot;
foxtrot = [[NSNumber alloc] initWithInt:24];
NSLog(@"foxtrot %@", foxtrot);
NSNumber *planck = [NSNumber numberWithFloat:6.626];

2 Answers

Holger Liesegang
Holger Liesegang
50,595 Points

Hi Andrew,

your answer seems to be ok, please take a look here

However Challenge task 3 of 4 "Declare another variable named 'planck' of type NSNumber and assign it the value 6.626." should work with:

NSNumber *foxtrot;
foxtrot = [[NSNumber alloc] initWithInt:24];
NSLog(@"foxtrot %@", foxtrot);
NSNumber *planck = @6.626;
Andrew Visser
Andrew Visser
2,752 Points

Hey Holger,

Great that helped, thank you.