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.