Chapter 3. Files and Data

In this chapter, we will cover the following points:

  • Reading PLIST data files
  • Reading JSON data files
  • Reading XML data files
  • Saving simple data using NSUserDefaults
  • Archiving objects into archive files
  • Mutating nested metadata
  • Saving data into a PLIST file
  • Saving data into a SQLite database
  • Saving data using Core Data

Introduction

Both simple and complex games process and persist data. This includes hi-scores, player profiles, and saved game sessions to name a few. In this chapter, we will use a number of varied techniques to read and write data.

Get Cocos2d for iPhone 1 Game Development 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.