[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: QSort.......
From: |
Ralf Stephan |
Subject: |
Re: QSort....... |
Date: |
Tue, 30 May 2000 13:27:06 +0200 |
> Marie-Edith Bissey:
> > The statement:
> >
> > [QSort sortObjectsIn: arrayOfDistance];
> >
> > does not crash the program, but basically does nothing: the elements
> > in the array are still in the same order.
>
> This invokes Value::compare which is probably not defined.
> This message has to be of the form int compare: (id) otherObject;
I just reworked my code with this method and it works, so I can
say it should for you, too. Just define for your class:
- (int) compare: otherId
{
if (self == otherId) return 0;
// some comparisons
// return -1/0/1
}
ralf
--
http://ME.IN-berlin.de/~rws/
==================================
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.