• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
NSDocument Application Close
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSDocument Application Close


  • Subject: NSDocument Application Close
  • From: Linea Tessile srl <email@hidden>
  • Date: Thu, 7 Apr 2005 22:16:31 +0200



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



 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: NSDocument Application Close
      • From: Ricky Sharp <email@hidden>
  • Prev by Date: Re: ADC Core Data article
  • Next by Date: Re: NSDocument Application Close
  • Previous by thread: Looking for a workaround regarding a bug in NSFileManager when dealing with AppleShare
  • Next by thread: Re: NSDocument Application Close
  • Index(es):
    • Date
    • Thread