Preserving Game State

With the advent of background execution on iOS devices, the importance of preserving game or application state is a bit reduced. But a fully functional and user-friendly application should be able to gracefully handle restoring state if the application is terminated. The steps required to preserve state are really not that different from storing other types of data. This is a critical feature of many applications.

The first thing we need to understand is when we should be trying to restore state or archive state. Figure 3–11 is a flowchart describing our sample application's life cycle in terms of initialization.

Image

Figure ...

Get Beginning iOS 5 Games Development: Using the iOS 5 SDK for iPad, iPhone, and iPod Touch 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.