Examining the Data File

If you run the preceding code in the simulator, you can easily inspect the SQLite file that Core Data creates. Navigate to the simulator folder (~/Library/Application Support/iPhone Simulator/Firmware/Applications, where Firmware is the current firmware release; for example, 7.0) and then into the folder for the application itself.

Stored in the Documents folder (depending on the URL used to create the persistent store), an SQLite file contains the database representation you’ve created. The command-line sqlite3 utility enables you to inspect the contents by performing a .dump operation:

% sqlite3 Person.sqlite SQLite version 3.7.13 2012-07-17 17:46:21 Enter ".help" for instructions Enter ...

Get The Core iOS Developer’s Cookbook, Fifth Edition 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.