[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
adding new objects to a model within an object
From: |
Andrew Boyd |
Subject: |
adding new objects to a model within an object |
Date: |
Tue, 20 Jul 1999 17:50:35 -0500 |
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.
Thanks for any and all help
Andy Boyd
UT Southwestern Medical Center
==================================
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.
- adding new objects to a model within an object,
Andrew Boyd <=