Does the array need to change length?
If not, why not use a normal array of ints:
int arr[] = { 1, 2, 3, 4, 3, 2, 2};
Note that an NSArray (or subclass thereof) doesn't hold int
types natively, you have to create an NSNumber object.
If you really need an Objective-C style array, then use this:
int vals[] = { 1, 2, 3, 4, 3, 2, 2}; // you still need this
int n = sizeof(vals) / sizeof(vals[0]);
[NSMutableArray* array = [[NSMutableArray alloc] initWithCapacity:n];
for (int i = 0; i < n; ++i) {
[array addObject: [NSNumber numberWithInt:vals[i]]];
}