Home > Articles > Programming > General Programming/Other Languages

  • Print
  • + Share This
This chapter is from the book


Why not build on what you’ve learned by experimenting?

  1. Set the current model version to Model 3 and run the application. It should not throw an error because the downgrade of data is inferred automatically. Note that this is only because NSInferMappingModelAutomaticallyOption has been re-enabled. In reality, you would need a Model4toModel3 mapping model to map attributes properly.
  2. Examine the contents of the ZAMOUNT table in LocalStore.sqlite and you’ll notice something critical: Where has all the data gone? There was no mapping model, so all the ZUNIT data was lost during the downgrade!
  3. Set the current model to Model 4 and then run the application to trigger an automatic lightweight migration. This should be fast because there is no data in the store.
  • + Share This
  • 🔖 Save To Your Account