Frage

Is a lightweight database migration still running if the app runs in background on iOS5/iOS6 ? If I start the migration, and then open another app, is the migration still going?

2. Is it running when the phone is locked on the initial screen as well?

thanks

War es hilfreich?

Lösung

No, there's no Core Data migration running when the app is in the background.

Reason: When the user updates your app it will be closed and then updated. The database migration is then running with the first start of the app after the update.

Edit: So what happens when the user clicks the Home-Button during the migration process? I'd guess that Core Data stops and rolls back to a valid state (version) and may restart after the user opens the app again. But I'm not quite sure.

Edit 2: After thinking about that I'm almost sure that my suggestion is correct. During the migration the Core Data stack is not finally initialized and it will be stopped when the user clicks the Home-Button. So when the user returns to the app and the app accesses the NSManagedObjectContext the first time, the Core Data stack has to be build up again. But to be 100% sure, please try it in the Simulator and Device – it should be less effort to do.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top