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];
It will not delete object from this
arraybecause yourNSMutableArrayhas becomeImmutable.You’re making copy of
NSArrayinstead of it make mutableCopy it will work –Or you can also use
initWithArray:method.