What would be the best way of remove object from nsmutable array and reindex the array ?. What I mean be reindex is for example:
in array of 20 objects I remove object with index 11. I have the 19 objects but the object on index 11 it would be nil. What I want is to have the array with the 19 objects with from 0..18.
You can just use
It will automatically reindex the array because “all elements beyond
indexare moved by subtracting 1 from their index”.See NSMutableArray Class Reference for details.