[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
A problem with getClass method of DefinedObject?
From: |
William S. Shu |
Subject: |
A problem with getClass method of DefinedObject? |
Date: |
Wed, 28 Apr 1999 13:54:01 +0100 |
The code:
@interface address@hidden
...
id pers;
// create Person with default world, value space and swarm
pers = [self createAgent: [Person class]];
compiles well, likewise the code:
id pers;
// create Person with default world, value space and swarm
pers = [self createAgent: [Person getClass]];
^^^^^^^^^^
where getClass is the corresponding method for the Objective-C's class
method above.
Unfortunately, inside createAgent at runtime, ) when I use Swarm's getClass,
createBegin: fails with a Segmentation fault (memory access violation).
Relevant code for createAgent is:
- (id) createAgent: (Class) aClass { // create Agent w min defaults
id agt;
// Create the agent, set his world, valueSpace and swarm
agt = [aClass createBegin: [self getZone]];
...
}
The question is: Am I using getClass illegally (the manual does not have
this option for class objects) or should getClass be swarm's answer to
Objective-C's class method? I seem to recall from some discussion that it
was (or was to be?) the same as the class method.
Thanks
William.
==================================
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.
- A problem with getClass method of DefinedObject?,
William S. Shu <=