• 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
Re: NSDocument close notification
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSDocument close notification


  • Subject: Re: NSDocument close notification
  • From: Dan Bernstein <cocoa-dev%email@hidden>
  • Date: Tue, 25 Feb 2003 21:15:13 +0200

Implement -(void)[NSDocument canCloseDocumentWithDelegate:shouldCloseSelector:contextInfo:contextInfo ] in your NSDocument subclass.

-- Dan
On Tuesday, February 25, 2003, at 07:05 PM, Bob Peterson wrote:

I need a notification of imminent NSDocument closure, one which allows the runloop to continue to run before actually doing the final close.

I have written an application which connects the user to a special device. I chose to make it a document-based application, since the user might (in theory) have more than one of these devices. Also the user can open past dialogs with the device for read only purposes. In fact, it is a lot like iChat over special hardware.

When an NSDocument is going to be closed I need to perform a handshake to shut down the device connection, and include in the document any final messages generated by that handshake. I've tried extending the close method, but that doesn't work. Because of the nature of the asynchronous communications my runloop has to keep functioning.

Should I roll my own document controller, subclass NSDocumentController, or is there some notification I've overlooked?
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >NSDocument close notification (From: Bob Peterson <email@hidden>)

  • Prev by Date: [Solved] Change NSToolbarItem appearence
  • Next by Date: RE: Making an app Scriptable
  • Previous by thread: NSDocument close notification
  • Next by thread: NSTableView and Drag&Drop
  • Index(es):
    • Date
    • Thread