对无序数组排序,并将某个元素插入到数组对应位置
首先是对无序数组的排序实现
假设数组oldArray中保存的是model,并且以model的number排序,利用系统的方法:
NSArray *orderArray = [oldArray sortedArrayUsingComparator:^NSComparisonResult(CustomModel * _Nonnull model1, CustomModel *_Nonnull model2) {
NSInteger number1 = model1.number;
NSInt