swarm-support
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Swarm-Support] Re: trouble with index


From: emcleskey
Subject: [Swarm-Support] Re: trouble with index
Date: Mon, 10 May 2004 14:33:00 -0600

Scott,
I did not have Flowfield.h #include 'ed in!  That was it.  I actually had 
defunct -getXPos and -getYPos functions in the BrownTrout.m file as well (the 
same place -step was) that I was initially going to use but ended up not 
needing and then neglected to take out.  The complier was looking at those 
functions and giving me the error message.  Thank you!

So, the header file of the class the list contains must be included in the 
implementation file where the method referencing that list is declared?  It 
wasn't clear to me from the swarm user guide that I had to include that file.  
Like I said, I'm relatively new to swarm and programming in general.  So if I 
can ask one more question, same topic...

My code (called in the brownTrout class) indexes through one list created in 
and containing objects of the flowfield class and then (as specified in the 
'while loop')adds them to another list CREATED in the brownTrout class BUT 
containing flowfield objects.  If I then want to index through that list 
(created in one class but containing items from another) and call functions, 
do I put them in the brownTrout.m or flowfield.m file?

It seems like the functions should be declared in the implementation file of 
the class contained in the list.  Is that correct?

Thanks again for your help,
Eric

///////////////////////////////////////////////////////////////////////

>I can see that the element variable is of type id, what I meant is the
>instances which are stored in the Index, what class are they.  I'm
>guessing from your later comments though that this is class FormField,
>which should be the class that defines the -getXPos and -getYPos
>methods.  So for the file that contains the code below, your while loop
>which calls those methods, is that file #include'ing the FormField.h
>file?  The only thing I can think of is the compiler is confused about
>the return type of those methods.  Another thing to try is to explicitly
>cast the element variable to the class so that the compiler knows
>exactly which class to look for the methods.

>elementX = [(FormField *)element getXPos];

>This may be a compiler issue, but sometimes it is hard to tell.  I think
>some versions of the compilers on Linux would give errors like this, but
>I don't really remember the details.

>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]