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) Advanced Objective-C Dynamic Typing

Fabrizio Rinaldi
Fabrizio Rinaldi
5,359 Points

Dynamic Typing

Ex:

Use NSLog to print out the value of the variable 'thing'. The output should look like: "thing = 4".

Answer:

id thing = nil;

NSNumber *four = @4;

thing = four;

NSLog(@"thing = %d", thing);

There is a mistake about the output, but i can't find it. i need some help! thanks to everyone :)

4 Answers

Calvin Nix
Calvin Nix
43,828 Points

Hey Fabrizio,

You simply have an issue with this line NSLog(@"thing = %d", thing);

See if you can find it :).

cough %@ cough

Fabrizio Rinaldi
Fabrizio Rinaldi
5,359 Points

Thanks Calvin, you saved me! :D

Derek Southworth
Derek Southworth
679 Points

Im incredibly stuck on this as well, even after the hint...

well, this helped me in solving the challenge! +30pts, Whassaaa!