//同時(shí)選中的幾個(gè)先從小到大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 存儲(chǔ)的是index的數(shù)組