In my application, I create many instances of NSColorwell, and as I create each new instance, I assign it to an array of NSColorwells. By assigning the instances to an array, I maintain a reference to each of them so that I am able to manipulate the position and color of the NSColorwells. So far, so good. But when I no longer need the NSColorwells, I cannot delete them. What I really want to do is free up the memory that they have been using. I tried the removeAll()
method for the array, but that merely cleared the array. No real surprise.
Is there a way to reclaim the memory?
I used
removeFromSuperview()
, which appears to free up the memory.