swarm-support
[Top][All Lists]
Advanced

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

Help on compiler messages


From: Fabio Mascelloni
Subject: Help on compiler messages
Date: Mon, 01 Feb 1999 13:13:15 +0100

This is perhaps more an Objective-C question than a SWARM question, but i hope you'll help me in the same way
I've added the method -kill (id) someBug to ModelSwarm.This method simply invokes [bugList remove: aBug] to remove a given element from bugList.
Then, inside the -step method in Bug Class i call [myModel kill: aBug] ,where
myModel is a variable of generic type id  declared in "Bug.h" that is assigned the value of the ModelSwarm that created it, through the message
[aBug setModel:self] ,during the Bug's creation phase.
The point is that during compiling, the compiler complains that...

Bug.m: in function '-[bug step]'
Bug.m:75: warning: cannot find method
Bug.m:75: warning: return type for 'kill:' defaults to id

Line 75 is that in which the message [myModel kill: aBug] is called;
However the application is created and runs well.
Here's my explaination(so tell me if I'm right or wrong):the compiler complains because method kill id defined elsewhere ans it can't find in Bug class,but the application runs because the link ModelSwarm object- kill message can be done at runtime, and so the runtime system is able to call kill.
Why this warning and what should I do to make it disappear(should I import "ModelSwarm.h" in "Bug.h" an declare myModel as a variable of Type ModelSwarm instead of generic type id)?
Thanks in advance.
Fabio.


reply via email to

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