Sorting Array in increasing order

前端 未结 7 579
鱼传尺愫
鱼传尺愫 2021-01-03 07:01

I have an array that contains values like 0,3,2,8 etc.I want to sort my array in increasing order.Please tell me how to do this.

Thanks in advance!!

7条回答
  •  暗喜
    暗喜 (楼主)
    2021-01-03 07:06

    You can sort the array in simple method using sortUsingSelector the code as follows.

    [array sortUsingSelector:@selector(compare:options:)];
    NSLog(@"array after sort in max:%@",array);
    

    i think its the simplest way without using any descriptors.

提交回复
热议问题