[Solved] getting NSArray objects using index numbers


Try this :

NSArray *arr = @[@"ECE",@"CSE",@"MECH",@"CIVIL",@"AERO",@"IT",@"EEE",@"EM"];

    NSArray *indexNumberArray = @[@0,@2,@5,@7];
    NSMutableArray *arrNew = [NSMutableArray new];
    for (NSNumber *index in indexNumberArray) {
       [arrNew addObject:[arr objectAtIndex:[index integerValue]]];
    }

Output

enter image description here

3

solved getting NSArray objects using index numbers