The iPhone OS offers two collection classes you will use often in your applications: NSArray and NSDictionary.
NSArray is a class provided by the Foundation framework that manages a flat ordered collection of objects. You are likely familiar with arrays in other languages, and NSArrays work in much the same way.
The easiest way to understand collections is to see them in action. Here is a quick sample, showing you how to initialize and iterate through an NSArray:
Some important notes about the preceding code:
• The syntax for arrayWithObjects: has an important detail. As you can see, you specify the objects you want in ...