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
Vincent Takizadeh
Courses Plus Student 410 PointsStruggling with Code Challenge: Getting to Know Arrays
I wrote the code as:
*myArray = = [[NSArray alloc] initWithObjects:@"Apple", @"etc", nil;
But I can't seem to get it right. Can anyone help me on where I went wrong?
Thanks,
Vince
7 Answers
Ernest Grzybowski
Treehouse Project ReviewerRight off the bat,
- You have two "=" signs
- You have two "[" and one "]".
Ernest Grzybowski
Treehouse Project ReviewerA variable will always be in this form:
NSString *myName = @"Ernest";
J V
1,774 PointsYou forgot to add your last ] and our only need one =
Vincent Takizadeh
Courses Plus Student 410 Points*myArray = [[NSArray alloc] initWithObjects: @"Apple", @"Orange", @"Banana", @"Plum", nil];
Tried to fix it with this but it still didn't work. Am I missing something else?
Thanks guys, much appreciated
J V
1,774 PointsYea, you forgot the class: NSArray *myArray= .......
Vincent Takizadeh
Courses Plus Student 410 PointsLegend! Thanks!
J V
1,774 PointsDon't forget your class. The variable is always referring to the class. It keeps your code readable and for the compiler to understand your code.