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
Khairul Akmal
Courses Plus Student 2,038 PointsMutable vs Immutable Quiz
Hey, I'm having an error when in a quiz for the Mutable vs Immutable.
Here are the errors I'm getting:
```NSMutableArray *elements;
[error snapshot](http://cl.ly/TKmD).
```NSMutableArray *elements = [NSMutableArray new];
Is it just me or the quiz is broken? Thanks.
2 Answers
Thomas Nilsen
14,957 PointsTry
NSMutableArray *elements = [NSMutableArray array];
RASHU BHATNAGAR
Courses Plus Student 2,669 PointsHi Khairul,
This should also work: NSMutableArray *elements; elements=[NSMutableArray new] ;
since in the code you provided: NSMutableArray *elements; error snapshot.
NSMutableArray *elements = [NSMutableArray new]; error snapshot.
elements has already been declared in the first line then in the second line the complier will take it as a redefinition of the array and that's why an error message will appear.
hope this should work....
Khairul Akmal
Courses Plus Student 2,038 PointsKhairul Akmal
Courses Plus Student 2,038 PointsCheers mate! It's working now. I really appreciate your help :)