I have an array NSMutableArray
with happy objects. These objects viciously turn on (leak) me whenever I try to clear the array of all the objects and repopulate it.
I'd say I don't really have enough Information here to give you a great answer. Are you saying that the NSMutableArray
is still allocated, but empty and doesn't have any objects in it but that the objects once previously in the array are still allocated even though they should be dealloc'd at that point in the app?
If that's the case the array could possibly be empty, but your objects aren't handling the dealloc message sent to them, in which case the objects are still around in memory but not referenced by anything.
I'd say to help you I'd like to know exactly what MallocDebug exactly says is being leaked. Also @Elfred is giving out some good advice in checking your @property
method for the array, really it should be retain or copy.