How to let the sortedArrayUsingSelector using integer to sort instead of String?

前端 未结 5 634
心在旅途
心在旅途 2020-12-02 02:10

I have some data like this :

1, 111, 2, 333, 45, 67, 322, 4445

NSArray *array = [[myData allKeys]sortedArrayUsingSelector: @selector(compare:)];
         


        
5条回答
  •  孤街浪徒
    2020-12-02 02:41

    Implement your own method that returns NSComparisonResult. It can be in a category if you wish.

提交回复
热议问题