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 trialmarkodr
1,534 PointsThere is a compiler error that I can't figure out.
I tried to solve this whit two different methods. Both works in Xcode but not on site. Can somebody explain to me why this doesn't work?
NSArray *shoeOrder = @[@"Charles Smith", @(9.5), @"loafer", @"brown"];
NSArray *shoeOrder = [ [NSArray alloc] initWithObjects:@"Charles Smith", @(9.5), @"loafer", @"brown", nil ]
NSArray *shoeOrder = [ [NSArray alloc] initWithObjects:@"Charles Smith", @(9.5), @"loafer", @"brown", nil ] ;
2 Answers
Jason Anders
Treehouse Moderator 145,860 PointsHey there,
Your first line is the correct one:
NSArray *shoeOrder = @[@"Charles Smith", @(9.5), @"loafer",@"brown"];
However, there seems to be currently a problem with Objective-C challenges on Treehouse returning this error when the code is correct. The Support Team is aware, but it wouldn't hurt to send them a note as well referencing the challenge link.
Hopefully this all gets fixed soon. :)
markodr
1,534 PointsThaks a lot !!!! Waiting for a fix I have one more problem, maybe it is the same issue.