Skip navigation.
 
mlNSDocument Application Close
FROM : Linea Tessile srl
DATE : Thu Apr 07 22:16:31 2005

Hi people!

I have a NSDocument based Application with a window which cointains a
NSView.

When I click on the red button close of the window I want terminate my
application, so I have used

- (void)windowWillClose:(NSNotification *)aNotification
{
    [NSApp terminate:self];
}

This works fine if I don't change my document!

When my document is modified and then I close the window, it is showed
a sheet with the message "Do you want to save the changes you made
...." and three button "Dont' save", "Cancel" and "save".

If I choose "Don't save", the application crashes!

I have also used the windowShouldClose method but it closes only the
window and ignores the message [NSApp terminate:self].

How can I close the application without problem?

Thans,
Alessandra

Related mailsAuthorDate
mlNSDocument Application Close Linea Tessile srl Apr 7, 22:16
mlRe: NSDocument Application Close Ricky Sharp Apr 7, 22:26