I have an application, where a second NSWindow
is opened by pressing a button. This new window is opened using [NSApp runModalForWindow:<myWindow>]
. I want to be able to determine if the user closes the second window, in order to stop the modal.
There are several ways to be notified when a window closes.
NSWindowWillCloseNotification
notifications from the second NSWindow
object.NSWindowDelegate
methods windowShouldClose:
or windowWillClose:
.NSWindow
and override the performClose:
method.Without more information, it's hard to advise which of these or other options would work best for you.