I am currently displaying a modal window by using this code:
[[NSApplication sharedApplication] runModalForWindow:mainWindow];
However, when I close this window, the other windows are still inactive. How do I run the stopModal method when the window is closed using the “red x”?
Thank you,
Michael
You can create a delegate for the window and have it respond to either the
-(void)windowWillClose:(NSNotification *)notification or the
– (void)windowShouldClose:(NSNotification *)notification methods like so:
See Mac Dev Center: NSWindowDelegate Protocol Reference