Code for Chapter 3 of the iOS in Action book