There were topics when breakpoint was not hit in the "deinit" method. The solution was to put an executable code inside. Tried that - didn't work.
The code to initiate a ViewController
from the first window:
let vc = self.storyboard?.instantiateController(withIdentifier: "testwindow") as! NSViewController
self.presentViewControllerAsModalWindow(vc)
It opens a new window with a button which calls the following code on click
dismissViewController(self)
and here is the deinit code with breakpoints.
zombie objects are not enabled in the scheme.
That wouldn't be a problem if the viewcontroller was re-used when the popup appears again, however new instances of the view controller are created every time.
Is there anything to do to make sure the object gets destroyed?