系统提供的有方法,大家看看应该会用的
- (void)exchangeObjectAtIndex:(NSUInteger)idx1 withObjectAtIndex:(NSUInteger)idx2;
[_mutArr exchangeObjectAtIndex:0 withObjectAtIndex:1];
mutArr的第一个元素和第二个元素互换位置系统提供的有方法,大家看看应该会用的
- (void)exchangeObjectAtIndex:(NSUInteger)idx1 withObjectAtIndex:(NSUInteger)idx2;
[_mutArr exchangeObjectAtIndex:0 withObjectAtIndex:1];
mutArr的第一个元素和第二个元素互换位置