O'Reilly logo

Anyone Can Create an App: Beginning iPhone and iPad programming by Wendy L. Wise

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 11. Collections

This chapter covers

  • Arrays
  • The for statement and loop
  • Dictionaries
  • Creating a state-name lookup app

Almost every app you’ll ever write will need some way to store data. You already learned about storing data in variables in chapter 8, but sometimes you need to store several pieces of data together in a grouping of some sort. This is where the idea of collections comes in—a collection of values that can be stored together. Imagine if you went to the grocery store and had to buy one egg at a time instead of a nice dozen packaged together. It would be a bit annoying, for sure. This chapter covers two different collection types (egg cartons) to store your data.

11.1. Quantum arrays: not really, but that sounds **br/** ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required