Objective-C has the same core containers that Swift does with the two exceptions that they are named slightly differently and all the containers in Objective-C are reference types because of the basic requirement that all Objective-C types must be reference types.
In Objective-C, arrays are called
NSArray. Let's look at the initialization of an array in both Swift and Objective-C side-by-side:
var array = [Int]() NSArray *array = [NSArray alloc]; array = [array init];
We defined a variable called
array that is a reference to the
NSArray type. We then assign it to a newly allocated instance of
NSArray. The square bracket notation in Objective-C allows us to call methods on a type or on an instance. Each separate call is always contained ...