Re: Typeing
Re: Typeing
- Subject: Re: Typeing
- From: "David P. Henderson" <email@hidden>
- Date: Wed, 27 Jun 2001 13:55:15 -0400
I know this has been answered by I wanted to comment for emphasis :)
On Wednesday, June 27, 2001, at 05:30 , David Remahl wrote:
>
warning: cannot find method
>
Read this warning literally whenever you see it. Since the compiler is
saying, "I don't see this method anywhere prior to the point of use".
When you see this warning, import the header file in which it is
declared in the file in which it is being called. Then this warning and
the subsequent will go away.
>
warning: return type for 'arrayOfObjects' defaults to id
>
All methods in Objective-C for which you don't explicitly state a return
type default to type id. Just like in ANSI C where all function without
an explicit return type default to type int. The compiler just wants to
make sure that you know you are holding the noose ;).
>
So, how do I statically type [NSApp delegate] so that the compiler
>
understands what I am trying to do?
>
If you really want to do this you would just cast it, (MyObject *)[NSApp
delegate], but you'll still get the warnings if MyObject's interface
file is not imported.
Dave
--
Chaos Assembly Werks
"Imagination is more important than knowledge."
- Albert Einstein