Skip navigation.
 
mlRe: Question about relation between File's Owner, First Responder and controller object...
FROM : Mikael Arctaedius
DATE : Tue Apr 12 06:16:56 2005

2005-04-11 kl. 22.36 skrev Ondra Cada:

> Mikael,
>
> On 11.4.2005, at 19:19, Mikael Arctaedius wrote:
>

>> OK, so I have an instance of my controller inside the document nib
>> file?
>> And the File's Owner in MainMenu is an instance of NSApplication and
>> in
>> the document nib file File's Owner is an instance of my document
>> class?
>> Is that correct?

>
> Could be, if there is some quite special need to do it this way.
> Normally though, the NSDocument subclass -- the document NIB's File's
> Owner -- is the document controller.


OK, I just follow a recommentation from Garfinkel&Mahoney (Building
Cooca Applications A Step-by-Step Guide page 328) to split
the functionality into a controller and a document class.

> In the MainMenu, you'll connect the menu action to First Responder.
> That will ensure the appropriate NSDocument subclass (of the active
> window) would get the message, and the redirection then would ensure
> the SystemController instance of yours--instantiated from the
> NIB--gets the message to do the work.


But the First Responder does not have the desired actions.
I have added items to the File menus that are implemented
in the document class (formely the controller class) and
those actions are not listed when I ctrl-drag from the menu
item to the First Responder... Neither the File's Owner
of the ManiMenu.nib (which is NSAppliction) has (of course)
the desired actions listed.


Sorry if I'm being a bit stupid, but I really don't get
these things... And I really want to learn to be able to
develop Cocoa applications (and convert my existing
applications too).


Thanks,


Mikael Arctaedius