Want notification that Document will Close
Want notification that Document will Close
- Subject: Want notification that Document will Close
- From: Jerry Krinock <email@hidden>
- Date: Fri, 29 Jan 2010 07:13:20 -0800
I want a notification that a document will close in order to do clean-up such as:
1. Clear my intra-app copy/drag collections of any items in the closing doc.
2. Unbind temporary bindings which I had bound in code.
3. Cancel NSURLConnections which may send messages to the doc.
I've been using -[NSDocument close], but in its documentation I read that "This method may not always be called". I've not experienced this. When might it not be called? [1]
I cannot use -[NSWindow close] because I'm developing a framework which is used in both an app and a background tool. The latter opens documents but, of course, no windows.
As always, the -dealloc method may be too late to avoid crashes.
Not using Garbage Collection.
Thank you,
Jerry Krinock
[1] It also says that "Additional information on application termination can be found in [another document] Graceful Application Termination." But I read the other document but did not find the answer, and also I'm interested in what happens when the document closes without application termination.
_______________________________________________
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