Old-style array methods
Before a literal syntax was introduced for creating instances of NSArray, developers used the class method arrayWithObjects:.
// Create an array containing three pointers (nil terminates the list) NSArray *dateList = [NSArray arrayWithObjects:now, tomorrow, yesterday, nil];
The nil at the end tells the method to stop. Thus, this date array has three objects. (If you forget the nil, it will probably crash your program, but you will at least get a compiler warning.)
The syntax that you used to access items in the dateList array is known as ...
Get Objective-C Programming: The Big Nerd Ranch Guide now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.