[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: adding new objects to a model within an object
From: |
Andrew Boyd |
Subject: |
Re: adding new objects to a model within an object |
Date: |
Tue, 20 Jul 1999 18:46:14 -0500 |
Hi,
Thanks, that seems to make it work.
Andy Boyd
UT Soutwestern Medical Center
<<< Ken Cline <address@hidden> 7/20 6:33p >>>
On Tue, 20 Jul 1999, Andrew Boyd wrote:
> Hi,
> I am a newbie, I have been searching for an answer to I think is a simple
> question but have not had any luck. I am writing a program will the major
> object is a Cell. In CellModelSwarm.m I have function that I have tried to
> write that will create a new cell. I am trying to have the swarm object Cell
> call the function in CellModelSwarm to make a new object.
>
> In CellModelSwarm.h after the interface {}
> - addCell: (Cell *)cll;
> In CellModelSwarm.m
>
> - addCell: (Cell *)cll
> {
> cll = [Cell createBegin: self];
> [cellList addLast: cll];
> return self;
> }
> In Cell.h
> @interface {
> id cellModelSwarm;
> }
> In Cell.m
> [cellModelSwarm addCell: newCell];
>
> I have tried to model this off of the heatBug addHeatBug and the U of M
> HeatBugPlus. I am not sure if I am calling the function of addCell
> improperly or I have not figured out what type of variable I need to pass to
> the function, i have tried a few different things. I have tried specifing
> super (as in Objective C code of calling a superclass), but that does not
> seem to work in swarm.
>
> The error I get when I try to compile is:
> Cell.m: In function `-[Cell step]':
> Cell.m:50: warning: cannot find method.
> Cell.m:50: warning: return type for `addCell:' defaults to id
> make: *** [Cell.o] Error 1
>
> However when I call other functions within CellModelSwarm it seems to
> compile.
Have you tried importing the "CellModelSwarm.h" file into
Cell.m?
This may cause its own problems, eg cyclic imports, depending
on what else you import, but I'd try that first.
Ken.
_________________________________________________________
Ken Cline address@hidden
SAIC VOICE (410) 571-0413
Annapolis, MD FAX (301) 261-8427
==================================
Swarm-Support is for discussion of the technical details of the day
to day usage of Swarm. For list administration needs (esp.
[un]subscribing), please send a message to <address@hidden>
with "help" in the body of the message.
==================================
Swarm-Support is for discussion of the technical details of the day
to day usage of Swarm. For list administration needs (esp.
[un]subscribing), please send a message to <address@hidden>
with "help" in the body of the message.