Re: more 'new to cocoa' problems...
Re: more 'new to cocoa' problems...
- Subject: Re: more 'new to cocoa' problems...
- From: Simon Stapleton <email@hidden>
- Date: Thu, 11 Oct 2001 13:43:29 +0100 (BST)
>
From: Ruben Westerberg <email@hidden>
>
To: email@hidden
>
Subject: more 'new to cocoa' problems...
>
>
Hi all,
>
>
Thanks for help with my last time posted, it helped a lot!
>
The next problem that i can't get my head around is as follows
(probably
>
>
some silly thing):
>
>
I have three objects all of different types.
>
Objects 2 and 3 are accessing object 1 through the same method,
>
>
-(SNPComponent *)currentCompnent;
>
>
When I compile I get no errors but 2 warnings:
>
>
warning: cannot find method.
>
warning: return type for 'currentComponent' defaults to id
>
>
If I comment out the call in object 2, leaving the same code
>
un-commented in object 3, this warning goes away.
>
Ruben
The warning is being generated because object 2 is not #import-ing
the header file that defines the interface for selector
currentComponent, would be my guess, and class 1 is defined with an
@class definition in the hpp.
This is not necessarily an issue - at runtime the application will,
most likely, run quite happily (gotta love that run time binding
stuff).
Of course, warnings are bad - too many of them and you'll miss the
important ones - so get rid of them by, where you've defined
something with an @class in your header, #importing the real header
file in your .m file.
Simon
--
PGP Key ID : 0x50D0698D
--
If the answer isn\'t obvious, the question is a distraction. Go find
an easier question.