I'm writing a multi-window program in Cocoa. When a user clicks on a certain button in the main window, it opens a second window, for which I have a custom subclass of NSWindowController. When the user closes that second window, it stays in memory, which is creating a bit of a memory waste, and also can also create the following error message in the console, which is related to the bindings in the window.
Any ideas how I can just completely deallocate the window controller when the user closes the window? Given how many windows can be open at once in this window, I'd rather not have any non-open windows taking up active memory space. I've tried using
and
but neither one worked.
<NSKeyValueObservance 0x10028e740: Observer: 0x1001cf530, Key path: available, Options: <New: NO, Old: NO, Prior: NO> Context: 0x0, Property: 0x100268150>
Any ideas how I can just completely deallocate the window controller when the user closes the window? Given how many windows can be open at once in this window, I'd rather not have any non-open windows taking up active memory space. I've tried using
Code:
[self dealloc]
Code:
[self autorelease]