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 Object-Oriented Objective-C Tying it All Together Cumulative Review

Andre Robinson
PLUS
Andre Robinson
Courses Plus Student 6,057 Points

Need help

Please help me with this first step i think I'm making a mistake with the array

variable_assignment.mm
NSNumbers *temps = @[@'75.5',@'83.3',@96,@'99.7'];



float average;

1 Answer

Jason Anders
MOD
Jason Anders
Treehouse Moderator 145,860 Points

Hey Andre,

The question is a bit tricky in the wording, and there are a couple things wrong with the code you have.

  1. The challenge wants you to create an array, so you need to call NSArray ... not NSNumbers. The NSNumbers are the type going in to the array, which brings the second error.

  2. Only NSStrings are enclosed in quotation marks, so you need to delete the quotes around each value in the array.

Have a look at the corrected code below. I hope it makes sense. :)

NSArray *temps = @[@75.5, @83.3, @96, @99.7];

float average;

Don't forget to mark as "Best Answer" if it solved your questions, so others in the forum know this post has been successfully resolved.

:dizzy: