If you are trying to do what I think you are trying to do in order to keep the array empty but not release it, or at least make it available the next time you need it, first you need to install a variable or property inside your class for this variable:
NSMutableArray *mutableArray;
Then add this code to the position where you need an empty array:
if (!mutableArray) { mutableArray = [[NSMutableArray alloc] init]; }
Now you can safely call
[mutableArray removeAllObjects]
without fear that the array will become inaccessible after empty.
sketchyTech
source share