Re: Getting notified when a document closes
Re: Getting notified when a document closes
- Subject: Re: Getting notified when a document closes
- From: Sherm Pendley <email@hidden>
- Date: Wed, 16 Mar 2005 22:58:13 -0500
On Mar 16, 2005, at 10:21 PM, Andrew White wrote:
When a document (NSDocument) closes, I want to signal all the other
documents in the application (some may need to redraw windows). Is
this possible / plausible? How do I do it?
The obvious way seems to be to iterate through [NSApp
orderedDocuments] calling a category method. The problem I can't work
out is how to find out *after* a document has closed that it has done
so.
You could subclass NSDocument's -close. According to its description,
it removes the document from the list of documents managed by the
document controller. So after you call super's implementation, you can
fire off a notification to other docs. The just-closed document should
have been removed from the doc manager's list by the time they get the
notification, although the object itself will probably be sitting in an
autorelease pool still.
-----------------------------------------------------------------------
---
This email and any attachments are confidential. They may contain
legally
privileged information or copyright material. You should not read,
copy,
use or disclose them without authorisation. If you are not an intended
recipient, please contact us at once by return email and then delete
both
messages. We do not accept liability in connection with computer virus,
data corruption, delay, interruption, unauthorised access or
unauthorised
amendment. This notice should not be removed.
_______________________________________________
That's kind of a silly disclaimer to post to an open list like this
one, isn't it? Ah, well, I suppose lawyers made you do it...
sherm--
Cocoa programming in Perl: http://camelbones.sourceforge.net
Hire me! My resume: http://www.dot-app.org
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden