gnustep-dev
[Top][All Lists]
Advanced

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

Re: NSDocumentController changes


From: Adam Fedor
Subject: Re: NSDocumentController changes
Date: Tue, 05 Nov 2002 14:01:18 -0700
User-agent: Mozilla/5.0 (X11; U; Linux ppc; en-US; rv:1.1) Gecko/20020905

Yes, I did check it with MacOSX, and it is not the application delegate. The documentation is ambiguous. In the class documentation, it says "as the application delegate...", but in the reference documentation on createng a doc-based app, it says something like "it's better to add extra functionality in you application delegate rather than trying to subclass NSDocumentController".

I didn't check to see if this was any slower. It shouldn't be unless there isn't any target for the action anyway, in which case it shouldn't matter. Perhaps adding an ivar would be good instead of checking isDocumentBasedApplication everytime. My whole point was to avoid creating an NSDocumentController if it wasn't needed. I'm not sure how MacOSX does it on that point. I can't tell if it always instatiates an NSDocumentController, or if there is some signal (like I use) to tell it to create one.

Fred Kiefer wrote:
Hi Adam,

I like the part of your change that now the document controller is put in the responder chain automatically. But I have some concerns with the way it gets done. It is not only that the current code does not correspond to the published documentation, it is also very slow. Please remember that targetForAction: is called for each menu entry without an explicit target during each loop cycle. Why didn't you set it as the delegate of the NSApp? In the Apple documentation NSDocumentController is refered to as the application delegate in the overview for this class. This looks like the most natural way to bring it into the chain. Do you have any proof that this is not the way it gets done for OpenStep or MacOSX?

I would also prefer to remove the method isDocumentBasedApplication again and make this check directly in finishLaunching, the only place where it would be needed.

Cheers
Fred




--
Adam Fedor, Digital Optics Corp.      | I'm glad I hate spinach, because
http://www.doc.com                    | if I didn't, I'd eat it, and you
                                      | know how I hate the stuff.





reply via email to

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