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

iOS

Mutable 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];

error snapshot.

Is it just me or the quiz is broken? Thanks.

2 Answers

Try

NSMutableArray *elements = [NSMutableArray array];

Cheers mate! It's working now. I really appreciate your help :)

Hi 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....