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 Basic Data Types and Variables Numerical Variables

David Adams
PLUS
David Adams
Courses Plus Student 555 Points

Line of code "float foodPrice = 3.5;". Cannot understand why code check is whining about an int.

Bummer! Did you create an int? I don't think so!

variable_assignment.mm
float foodPrice = 3.5;
Akshat Jain
Akshat Jain
12,819 Points

You need to complete both objectives to pass the challenge. Just add

int size  = 13;

to the top of the file.

2 Answers

David Adams
PLUS
David Adams
Courses Plus Student 555 Points

Thanks, Akshat! Yes, I had erased the prior line of code. The instructions were unclear.

Steven Deutsch
Steven Deutsch
21,046 Points

Hey David Adams,

EDIT: I misread this thread as your answer + the comment below being one post. They blended together xD

That's odd. When trying to replicate this problem the code challenge misbehaved for me as well. I just restarted my browser and everything worked fine after that. I suggest you try the same if you haven't already.

Also, in the example code you posted, your int declaration has an extra space on the left side of the assignment operator. This could be whats causing the problem.

Good Luck