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

Chris Bernardi
Chris Bernardi
3,994 Points

Challenge task Step 3 of 4: Not sure why given answer is incorrect

The question: Declare another variable named 'planck' of type NSNumber and assign it the value 6.626

My answer of:

NSNumber *planck = [NSNumber numberWithFloat:6.626];

was said to be wrong. How does that vary from:

NSNumber *planck;
planck = @6.626;

screenshot

1 Answer

Troy Fine
Troy Fine
7,592 Points

Hi Chris,

Task 3 of 4 in the code challenge is simply combining the instructions in the first two task of the code challenge.
Instead of declaring just the variable and in a second line of code assign the value, in this challenge you will do both at the same time.

Hint: You won't need to pass any messages or use any methods to complete the task. Just remember to use the NSNumber literal expression like you already did in code line 2. aka the @ symbol.