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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to