How does the active application terminate when the battery runs out on the iOS device and shuts down?

I run my own tests, but I am also interested in the experience of other users in various iOS devices, and also that this behavior is documented anywhere in Apple (because I cannot find it).

In addition, I am interested in learning how to deal with this situation for applications that rely on continuous file I / O (for example, an application with Core Data / sqlite data). Is the best solution to check the battery through UIDevice and not try to write to the database if the battery is low?

Motivation: I have an iPod Touch user who reports a significant data loss after the device has finished using battery when the application was in use. It seems the DB file was corrupted. Based on what the user is doing, the operation to save the master data was probably initiated immediately before turning off the device.

Update: I am working on getting the actual database file from the user to analyze how it got corrupted (I believe it is corrupted because the current behavior of the application indicates that persistent storage is loaded and some data may be read, but new changes cannot be saved). I stupidly have no way to do this, built into the application. However, I think it is possible to extract the database file from a custom unencrypted iTunes device backup using this utility.

+3
source share
2 answers

, , . , , .

, , , , .

+1

ios 5.1, , .

, (db.sqlite say), (db ~.sqlite). ( , - , ). , , . , , ?

, . ? , ! , , .

-1

Source: https://habr.com/ru/post/1774708/


All Articles