• 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
applicationShouldTerminate gets called on with no edited documents
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

applicationShouldTerminate gets called on with no edited documents


  • Subject: applicationShouldTerminate gets called on with no edited documents
  • From: Brad Stone <email@hidden>
  • Date: Fri, 11 Jun 2010 17:51:02 -0400

I have (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sender in my app delegate and it gets called when the user quits if **no** documents have been edited (I'm using Core Data). If one of my documents **is** edited it doesn't get called.  It goes right to - (void)closeAllDocumentsWithDelegate:(id)delegate didCloseAllSelector:(SEL)didCloseAllSelector contextInfo:(void *)contextInfo in my subclassed NSDocumentController.

I set up a breakpoint in my subclassed NSDocumentController at closeAllDocuments and I see this when I quit (assuming there's an edited document):
0 -[SRDocumentController closeAllDocumentsWithDelegate:didCloseAllSelector:contextInfo:]
1 -[NSDocumentController(NSInternal)_shouldTerminateWithDelegate:shouldTerminateSelector:]
2 -[NSApplication _shouldTerminate]
3 -[NSApplication terminate:]
........


I want to have an opportunity to send an NSApplicationTerminateReply before closeAllDocumentsWithDelegate is called. If applicationShouldTerminate would get called like it does with no edited documents I would be in great shape.

Can anyone help me?_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: applicationShouldTerminate gets called on with no edited documents
      • From: Reinhard Segeler <email@hidden>
  • Prev by Date: Re: NSTrackingArea pending install - NSTrackingEnabledDuringMouseDrag not working
  • Next by Date: A variable-height "Small List" view with [+] and [-] buttons
  • Previous by thread: Re: NSTrackingArea pending install - NSTrackingEnabledDuringMouseDrag not working
  • Next by thread: Re: applicationShouldTerminate gets called on with no edited documents
  • Index(es):
    • Date
    • Thread