Debugging on phone data disappears

Casually working on an iPhone app that collects some data and saves it in a text file in the Documents folder. Appears to work (so far) on phone.

Now, trying out a new feature, I want to debug on the device. The data seems to be erased.

Is this a bug or feature? In either case, can it be changed? Or, should I put my file some place else?

Now I can’t reproduce the problem. Data seems to remain. Not sure what’s going on, but it appears my initial report was wrong.

Did you by any chance delete the app from the phone before the test where the data disappeared?

In iOS, Apple will automagically delete associated data when an app is removed. However, if you just install a revised app (with the same “bundle id”) the data is retained. This is an iOS thing; not Xojo.