Re: NSDocument close notification
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.