Object is not being deleted from NSMutableArray?

arrays, ios, iphone, nsmutablearray, objective-c

Solution

It will not delete object from this `array` because your `NSMutableArray` has become `Immutable`. You're making copy of `NSArray` instead of it make mutableCopy it will work -

NSMutableArray *myArray = [array mutableCopy];

Or you can also use `initWithArray:` method.

NSMutableArray *myArray = [[NSMutableArray alloc] initWithArray:array];

Problem

I have a `NSMutableArray` when I try to delete object from it, object is not being deleted. And when I debug my code there is data in it. Here is my code - ``` NSMutableArray *myArray = [array copy]; // array is NSArray which contains data [myArray removeObjectAtIndex:0]; ```

Original source