I have a loop which adds values to an NSMutableArray, however when I move on to the next batch I need to clear down and initialise the array to add the next lot of data and I thought using [jobList release] would do the trick but it doesn’t. Could someone please let me know what I can use to reset the array after each iteration.
I have a loop which adds values to an NSMutableArray , however when I
Share
If you send
-releaseto it, then it is likely, but not certain that the object will be deallocated and not cleared as you want it to be.The solution is super-simple: Use the
-removeAllObjectsmethod: