17 NSArray
NSArray is another commonly used Objective-C class. An instance of NSArray holds a list of pointers to other objects.
Create a new project: a Foundation Command Line Tool called DateList. This program will create an array that holds a list of pointers to NSDate objects.
Creating arrays
Open main.m and change main():
#import <Foundation/Foundation.h> int main(int argc, const char * argv[]) { @autoreleasepool { // Create three NSDate objects NSDate *now = [NSDate date]; NSDate *tomorrow = ...
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.