The sortedArrayHint method of the NSArray class, what is the purpose of use and how is it used?

The question is the same as in the title. (the sortedArrayHint method of the NSArray class, what is the purpose of use and how is it used?)

I read the link to the developers, but the explanation is not detailed. therefore can not know the purpose and how to use.

Who can explain the purpose and use?

Please, your help ..

+5
source share
1 answer

The idea is simple. Suppose you have a large array that you always need to sort. Changing or pasting even one element means you need to resort to an array. Sorting is expensive.

-[NSArray sortedArrayHint] , , , , .

:

  • -[NSArray sortedArrayHint].
  • ; -[NSArray sortedArrayUsingFunction:context:hint:] .
  • ; -[NSArray sortedArrayUsingFunction:context:], .

- , .

, NSArray NSMutabelArray , , . : https://github.com/Jayway/CWFoundation

+9

All Articles