[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSDocument close & NSApplication targetForAction

From: Adam Fedor
Subject: Re: NSDocument close & NSApplication targetForAction
Date: Mon, 22 Sep 2003 09:06:01 -0600

On Sunday, September 21, 2003, at 02:20 PM, Fred Kiefer wrote:

Adam Fedor wrote:
I don't really see where it says this, unless it's somewhere in the
NSDocument documentation. NSApplication documentation doesn't mention
anything about documents.

Exactly there in the class description for NSDocument.

The second part is even worse, here closing the window and closing the document are mixed. This are two almost independend operations. A document may have multiple windows and may only close when the last one gets closed or sometimes not even then. Again I understand why this patch was intendend, but it tries to solve the problem the wrong way.
I looked at this again and found the real reason this doesn't work. I
put this patch in instead:

Wonderful that you found the true reason for the problem. One last question: Don't we need similar code in [NSWindowController setWindow:]? In your last change in that area (2002-11-02) you also changed both places.

I think I should start documenting why I did a change :-( I went back and read the original bug about this and realized why I took that line out before. However I think I am right in putting the line back in (and should do it in the other place as well). Some documentation here:

http://developer.apple.com/documentation/Cocoa/Conceptual/Documents/ Concepts/WindowClosingBehav.html#//apple_ref/doc/uid/20000027

makes it clear that the window and controller should be released when it is closed.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]