Z S
Z S

Reputation: 7479

Why does Core Data migration run on app launch?

I have successfully done Core Data lightweight model migrations before in my app, but currently I'm struggling to deal with an issue where the migration seems to run as soon as the app is updated and run, even before UIApplication's willFinishLaunchingWithOptions method is called, let alone setting up the Core Data stack. One of my goals in this migration is to fix some bug with a Transformable property, so it's vital that I load up the app's persistent store with the old model initially so I can fix some things before running the lightweight migration. But in my testing, it seems that the SQLite store file is changed to the new model as soon as the updated app is installed and run, which signifies that the lightweight migration has already run before the updated app is up and running.

Some details:

What's the best explanation for this issue, and/or the best way to debug something like this? I'm a bit stumped, and don't know where to look.

Upvotes: 0

Views: 33

Answers (0)

Related Questions