Re: A niceMessage in MyDocument
Re: A niceMessage in MyDocument
- Subject: Re: A niceMessage in MyDocument
- From: "David W. Halliday" <email@hidden>
- Date: Tue, 19 Jun 2001 20:21:16 -0500
- Organization: Latin AmeriCom, formerly Latino Online
Joshua D. Orr wrote:
>
Does your "MyWindowController.m" import the header file "MyDocument.h"? It
>
can't find the method, that is it's first complaint. Always take the first
>
complaint more seriously, because fixing the first one sometimes can fix
>
other complaints... (I don't know about the rest of you, but it seems to
>
happen that way to me a lot).
Oh, quite true. However, since the returned type of "[self document]" is
"id" (at least, according to the online documentation) including the
"MyDocument.h" file will do no good. (However, if the return type for "[self
document]" /were/ "id", the compiler /shouldn't/ be giving these errors. Maybe
the /actual/ return type is (NSDocument *).)
>
>
also, if you are sending the message [[self document] niceMessage] in
>
MyWindowController.m, then you are trying to send the niceMessage to a
>
instance of MyWindowController, and not MyDocument.
Not true, Joshua. This is passing the "niceMessage" message to the result
of passing the "document" message to "self" (the MyWindowController instance).
The result of sending the "document" message to the "MyWindowController"
instance is to obtain the document that's associated with this instance of
"MyWindowController". So you /shouldn't/ need any other connections for the
document instance.
>
...
>
>
-Joshua D. Orr-
>
>
...
By the way, Ivan, the MyWindowController.m file /does/ include (import) the
MyWindowController.h file, which, in turn, does include the NSWindowController.h
file? Just checking. :-)
By the way, according to the NSWindowController.h header file, what /is/ the
return type of the "document" message?
David email@hidden