同时按index删除多个选项

//同时选中的几个先从小到大index顺序排列,再逆序遍历一起删除

NSSortDescriptor *descriptor = [[NSSortDescriptor alloc]initWithKey:nil ascending:YES];
NSArray *sortArray = [NSArray arrayWithObjects:descriptor,nil];
NSArray *sortedArray = [arraySomeWaterIndex sortedArrayUsingDescriptors:sortArray];
for(int i=sortedArray.count-1;i>=0;i--){
            Tree *info =[self.arr objectAtIndex:[sortedArray[i] intValue]];
            [self.arr removeObject:info];
}

其中arraySomeWaterIndex 存储的是index的数组

你可能感兴趣的:(同时按index删除多个选项)