Hi,
Banlu Kemiyatorn wrote:
hello, I have a question.
how can I stop sorting an array while it is being sorted?
I want to sort a big array in a seperated thread but sometimes
the data that being sorted is obsolete and I don't want to
waste cpu time with that thread anymore. is it a safe way to
release the array and exit thread within the compare method?
No it wouldn't be as the code doing the sorting has no way of knowing
that 'self' (a variable) has become obsolete. I think you will
probably need a custom subclass of NSArray which implements an
invalidatin mechanism a sorting routine which uses it.