Welcome to the Treehouse Community
The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Stu Cowley
26,287 PointsHuh? NSMutableArray Code Challenge Part #3 (BlogReader Project)
Hey guys,
I've stumbled across an issue that I am having with this section of the code challenge.
The question would like me to remove the second object from your 'elements' array.
Here is my current code
NSMutableArray *elements = [NSMutableArray arrayWithCapacity:0];
[elements addObject:@"Helium"];
[elements addObject:@"Neon"];
[elements addObject:@"Argon"];
I go ahead and remove the following line (starting the count at 0 from helium, if that's what I'm meant to do):
[elements addObject:@"Argon"];
I go ahead and check the changes and it is incorrect. Could someone please, please, please give me some advice on this. I'm stumped on what to do as I'm still a little shaky with objective-c.
Thanking you in advance
Stu :)
3 Answers

Steve Hunter
57,684 PointsIs it looking for
[elements removeObjectAtIndex:1];
Rather than just deleting the creation of the index, this removes it programatically.

Stu Cowley
26,287 PointsHey Steve,
Of course, forgot about that little bugger. Thanks for that mate :)
Stu

Steve Hunter
57,684 PointsNo problem - glad to be of some help!

MUZ140316 Milton Chitsike
7,344 Pointsor you can go around and do it this way. NSMutableArray *elements = [NSMutableArray array]; elements = [NSMutableArray arrayWithObjects:@"Helium", @"Neon", @"Argon", nil]; [elements removeObjectAtIndex:1];