December 2013
Intermediate to advanced
132 pages
1h 58m
English
CHAPTER 8
![]()
Arrays
NSArray
NSArray is a class used to organize objects in lists. NSArray can maintain an index of objects, search for objects, and enumerate through the list. Enumeration is the process of moving through a list one item at a time and performing an action on each item in the list.
To create an array, you include a comma-separate list of objects enclosed in square brackets and started with the @ symbol.
NSArray *numbers = @[@-2, @-1, @0, @1, @2];NSArray *letters = @[@"A", @"B", @"C", @"D", @"E", @"F"];
The NSArray object numbers has a list of NSNumber objects, while letters has a list of strings. Any object can be put into an NSArray ...
Read now
Unlock full access