19.0. Introduction

iCloud is Apple’s cloud infrastructure. A cloud is a name given to a service that stores information on a centralized location, where the user cannot physically access the disk/memory that stores the information. For instance, an iCloud storage space could be allocated by Apple in California, and all iPhone devices in New York could have all their iCloud traffic go to the California iCloud data center.

The purpose of using iCloud, from a programmer’s perspective, is to give their users the ability to seamlessly have their apps’ data transferred from one machine to the other. Let’s have a look at a real life example of when iCloud would come in very handy: imagine that you have developed an app called Game XYZ. Sarah is a hypothetical user of your game and she has purchased it through the App Store. Your game is a universal app, and hence can be run on both the iPhone and the iPad. It just so happens that Sarah has an iPad and an iPhone, and has installed your game on both her devices. She is playing your game at the office, and is at level 12. She goes back home and picks up her iPad to play some more, only to discover that the game starts from level 1 on her iPad because she was playing on her iPhone all along. This is definitely not a pretty situation. What is better is for your game to be intelligent enough to save its state and resume that state when your users start the game, regardless of which device they have been running the game. To handle this situation, ...

Get iOS 6 Programming Cookbook 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.