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 trialRyan O'Connor
11,282 PointsNSMutableArray
Create an NSMutableArray object called 'elements'.
array should have 0 capacity.
How do i do this?
4 Answers
Camilo Castro
Courses Plus Student 2,549 PointsNSMutableArray * elements = [NSMutableArray array];
Patrick Serrano
13,834 PointsYou'll want to allocate and initialize an empty NSMutableArray. If you're still confused, you should take another look at the video related to the code challenge.
Jayden Spring
8,625 PointsNSMutableArray *elements = @{};
Stephen Wall
Courses Plus Student 27,294 PointsUsing the following will create an empty array, no need to set the capacity to 0.
NSMutableArray *elements = [NSMutableArray array];