Chapter 12. Reading and writing application data
This chapter covers
How useful would the Contacts application be if all your contacts were gone when you quit the application? Or how useful would the Notes application be if all your notes were lost when you turned off your iPhone? Not very useful at all. What is the one thing that makes these and most other applications useful? It’s data persistence: the permanent storage of data that “survives” the closing of an application or even the restart or shutdown of the device.
Data persistence is needed in almost every application in one way or another. In a game, you might need to save high scores, user data, or game progress. In a productivity application, you want to save, edit, and delete to-do list items. Or in an RSS reader application, you want to save which feeds the user subscribes to. How do you persist data on the iPhone?