algorithm - How do I Sort Collections in Objective-C? -
I have an integer array in my objective-program. I want to sort it (ascending or descending, it does not matter) in C ++ I use the sort algorithm in the STL algorithm library. how can I do this?
The method of "cocoa" is to create an NSNumber object, assign them an NSArray, and Using Selector: @Sylector (compare) Use the method (or one of the other NSRA sort methods).
If you want to create a series of primitive NSInteger (int) values, then you can use the C function underlying.
Comments
Post a Comment