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!
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
Michael Henry14,601 Points
initializing a mutable array
Hi folks -
I know that I am doing something wrong here (I'm trying to initialize a mutable array) - what is it???
NSString *myString1 = @"one"; NSString *myString2 = @"two"; NSMutableArray *items = [NSMutableArray arrayWithObjects:myString1, myString2, nil];
Amit BijlaniTreehouse Guest Teacher
You are re-declaring the array. You are supposed to the use the property which was defined in the first task. Your code would look something like this:
self.items = [NSMutableArray arrayWithObjects:myString1, myString2, nil];
PS. For code formatting you need to use three backticks followed by the name of the language: ```objective-c