I want to use windowShouldClose:
in my NSWindowController subclass to pop up a sheet asking if the user wants to save changes before closing with Save, Cancel, and Don't Save buttons.
The issue I'm running in to is that beginSheetModalForWindow:...
uses a delegate instead of a return value.
I can return NO in windowShouldClose:
, but then when I send [self close]
to the controller in the panel's delegate nothing happens.
Can somebody explain to me how to do this or point me in the direction of some sample code?