There are several notification methods when closing a window.
- You can observe
NSWindowWillCloseNotification notifications from the second NSWindow object. - You can implement the
NSWindowDelegate windowShouldClose: or windowWillClose: . - You can subclass
NSWindow and override the performClose: method. - You can add the Close button to the window and connect it to the action.
Without additional information, itβs hard to tell which of these or other options will work best for you.
source share