Re: Document-Based, but not really...
Re: Document-Based, but not really...
- Subject: Re: Document-Based, but not really...
- From: Sam Goldman <email@hidden>
- Date: Sun, 09 Dec 2001 04:57:51 -0800
On 12/9/01 3:50 AM, "Ondra Cada" <email@hidden> wrote:
>
Sam,
>
>
>>>>>> Sam Goldman (SG) wrote at Sun, 09 Dec 2001 02:04:14 -0800:
>
sure. Just DIY: whenever you want to make a new window, load the NIB
>
yourself. Create the appropriate window controller if you want to.
Thanks, worked like a charm!
>
SG> A second question: I also want to add my own menu items and have them do
>
SG> stuff. What I have done is set up a NSObject subclass ("Menu_Controller")
>
SG> in the MainMenu.nib and then set the targets of the menu item to my main
>
SG> controller. When I do that, the action seems to be connected (chacked
>
SG> with NSLog()), but nothing else happens.
>
>
What else _should_ happen?
It should reset the table view with new data. The data comes from my own
class which does a little more than NSFileManager.
>
SG> As far as I can assume, I am going about this all wrong and there are
>
SG> better (working) ways to do this.
>
>
Generally, connecting actions to First Responder and catching them in the
>
responder chain is better. In you special app though the way of a special
>
controller in the main NIB might be more appealing -- it all depends.
What would it depend on? Basically the menu items should be able to access
what's in the windows' individual controller. At the same time, it needs to
access the main controller for stuff like opening new windows and closing
them up.
What I have set up now, is that the main controller is in the responder
chain (I'm not sure how it got there, but it works... Maybe because its the
delegate to the file owner).
Would it make sense to add the individual windows' controller object to the
responder chain next and have it do that? If I did it that way, would there
be a problem if there are many windows open at once? I want them to act as
separate units, so wouldn't it be a problem if all the windows' controller
objects caught the actions? Or would they all catch them?
- Sam