Reputation: 13753
How can I display an NSAlert when an NSWindow attempts to close? This will also have to be turned on and off.
Upvotes: 0
Views: 1011
Reputation: 237060
NSWindow's delegate has a windowShouldClose: method that will allow you to customize this. There's also NSWindow's documentEdited methods that let you mark a document as having unsaved changes, which might interest you.
Upvotes: 1