Home > Articles > Home & Office Computing > Mac OS X

Introduction to Migration in Apple's Core Data

  • Print
  • + Share This
When Core Data was introduced in OS X 10.4 Tiger, there was one glaring hole: You could not upgrade your data store without having to write a tremendous amount of code. Now in OS X 10.5 Leopard, this hole has been filled. Marcus Zarra walks you through the steps required to use the new versioning and migration API that has been added to Core Data in OS X 10.5 Leopard.
Like this article? We recommend

Like this article? We recommend

Core Data was introduced with OS X 10.4 Tiger. In a nutshell, Core Data is an object graph for data storage that can be used like a database and contains its own persistence engine.

With this framework, developers could avoid having to deal with writing their own storage formats and all the troubles that come along with it. This also greatly reduced the amount of code that a developer needed to write since the entire object graph was contained within Core Data.

Why Do I Need to Care About Core Data Migration?

However, there was one area that Core Data was sorely lacking. Most of the persistent formats that Core Data supported locked the data to that format. What this means is that if you changed your data’s structure from one version to the next the older data could no longer be read in by the newer version of your application.

Worse still, when you looked to the Core Data framework for help with this issue, the only answer was to do the migration yourself. Fortunately, it has all changed with OS X 10.5 Leopard.

  • + Share This
  • 🔖 Save To Your Account