I am creating an array with the following capacity 15 in this way:
meuArray = [[NSMutableArray alloc] initWithCapacity:15];
But when I try to insert an object initially in position 10 like this:
[meuArray insertObject:algumObjeto atIndex:10];
I get an error saying that I have exceeded the size of the array:
* Terminating app due to uncaught exception 'NSRangeException', reason: '* - [__ NSArrayM insertObject: atIndex:]: index 10 beyond bounds for empty array '
How could I solve this?