Question: Say I wanna create an array of images and i used this:

```
NSMutableArray *images = [[NSMutableArray alloc]init];

```

what role does init really play here? won't it work if I simply use:

```
NSMutableArray *images = [NSMutableArray alloc];

```

Please help. Thanks.

Answer: 
No, you absolutely cannot just say `[NSMutableArray alloc]`. Calling a method on the results of sending `+alloc` to *any* class is absolutely incorrect unless that method is one of the `-init...` methods. All `+alloc` does is reserve the memory for the object. It's basically equivalent to calling `calloc(sizeof(class), 1)`. The `-init` method is crucial to actually initialize the object into a working state.
Though there are lots of "swizzles" inside Objective-C to short-circuit the scheme in some cases, in the theoretical model `alloc` creates (allocates from heap) space for the object only. The contents of the space is essentially random -- whatever was left over from the previous object to occupy that location.

After `alloc`, `init` initializes the space in a class-specific fashion. For an NSMutableArray, this means that a header is created (the first part of which is actually created by the `super` call to `init` for NSObject) and things like the number of array entries in use are initialized.

Note that for NSMutableArray you can invoke the `array` "convenience" method rather than `alloc/init`, to perform the equivalent of `[[[NSMutableArray alloc] init] autorelease]`. And for any class you can invoke the `new` "convenience" method to perform the equivalent of `[[SomeClass alloc] init]`.