Objective-C Language Add objects to NSArray


Example

NSArray *a = @[@1];
a = [a arrayByAddingObject:@2];
a = [a arrayByAddingObjectsFromArray:@[@3, @4, @5]];

These methods are optimized to recreate the new array very efficiently, usually without having to destroy the original array or even allocate more memory.