Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
So far, adding the ability to load and save data has required two ways of representing the same data: objects in memory and objects serialized to storage. Sometimes, it is appropriate to have two representations because storage and memory have significantly different performance and size characteristics. Often, however, the bulk of your innovation lies elsewhere, and writing a storage layer is grunt work that simply replicates the off-disk layout: a violation of the “Don’t Repeat Yourself” (or DRY) principle. Core Data, introduced in iPhone OS 3.0, provides a solution for this case. Figure 18.1 shows the constituents of Core Data.