This does not increase the number of deductions. The initial alloc sets the hold value to 1.
However, you should never call the init method more than once on an object. Although your example may work, at best it probably obj3 in the internal storage and does not release your obj1 , obj2 and obj3 . In the worst case, it may have an inconsistent internal state and may lead to failure.
If you do this just a couple of times, you can create a new array:
NSArray* myArray = [NSArray arrayWithObjects:obj1, obj2, obj3, nil];
If you do this a lot, for example in a loop, you should probably use NSMutableArray:
NSMutableArray* myArray = [NSMutableArray array]; for (...) { [myArray removeAllObjects]; [myArray addObject:obj4]; [myArray addObject:obj5]; [myArray addObject:obj6];
source share