swarm-support
[Top][All Lists]
Advanced

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

[Swarm-Support] How to addafer an object?


From: HU Xiaojun
Subject: [Swarm-Support] How to addafer an object?
Date: Mon, 17 Jan 2005 10:03:06 +0800

Hi,

I have a question.
I want to remove an object from a list and insert another object at the same
postion.

- a function
{
....
id <Index> relationIndex;
id element;
id newelement=nil;
relationIndex = [relationList begin: [self getZone]];
for(element = [relationIndex next]; [relationIndex getLoc] == Member; element =
[relationIndex next])
{
     if(....)
         { 
        [relationIndex remove];
        newelement=....
         [relationIndex addAfter: newelement];
         }   
        
}
[relationIndex drop];
return self;
}
When I compile it, it complains that method "addAfter" not implemented by
protocol.
so I made some change,I decalre the relationIndex as:
id <ListIndex> relationIndex;
and keep the other things.
when i compile it, it complains that in the line of 
"relationIndex = [relationList begin: [self getZone]];" objects does not comform
to the "listindex" protocol.
I don't know how to define a RETURNABLE listindex, can somebody help me? 
The version is swarm-2.1.1.

Best regards!

xiaojun


Tsinghua Univ.
Beijing




reply via email to

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