I am on XCode 8.2, OSX not iOS, Objective-C
I have an NSMutableArray with NSMutableArrays like this
@[
@[@"value1",@"value2",@"value3",@"value4",@"value4"],
@[@"value1",@"value2",@"value3",@"value4",@"value4"],
@[@"value1",@"value2",@"value3",@"value4",@"value4"]
]
The values inside are completely dynamic. The above example is for demonstration. I need to filter these NSMutableArrays inside by multiple indexes. So - given indexes 1 and 3 the result should look like this
@[
@[@"value2",@"value4"],
@[@"value2",@"value4"],
@[@"value2",@"value4"]
]
I already have a functional method with iterating over every array and removing the unneeded items at the corresponding indexes but this is very slow - so any recommendation to speed things up is welcome.
My current solution:
NSMutableIndexSet *indexes = [NSMutableIndexSet new];
[indexes addIndex:1];
[indexes addIndex:3];
for (NSMutableArray* theArray in allArrays)
[theArray removeObjectsAtIndexes:indexes];