I am developing cocoa application having multiple windows. There is a red close button on left corner of window. And I want to handle click event of close button so that I can show message to ask user whether he wants to close window or not. If user accept to close window then application will be terminated otherwise same window shown to user. Any idea how can I handle click event of close button???
Please look at NSWindowDelegate protocol reference, the method which you are looking for is-
- (BOOL)windowShouldClose:(id)sender
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With