[Solved] Auto increasing numbers in array
There are too many magic numbers in this code, but here you go: // Build an Array of keys @[@”item_1_type_1″, @”item_1_type_2″, …, @”item_1_type_9″] programmatically const int numberOfElements = 9; NSMutableArray *keys = [NSMutableArray arrayWithCapacity:numberOfElements]; for (int i = 1; i <= numberOfElements; i++) { [keys addObject:[NSString stringWithFormat:@”item_1_type_%d”, i]]; } // Extract chosen keys from JSON … Read more