Add objects to NSArray

suggest change
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.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents