UserDefaults getting erased on Simulator, some Devices

UserDefaults are getting erased for me on the Simulator (15.0) every time. Some users (iOS/iPad OS 15.0.2) are reporting to me that my app is erasing all their settings after re-launch.

In the Simulator, I can reproduce this by quitting the app and relaunching it manually. The same procedure does not cause loss of date on my iPhone or iPad running 15.0.2, but does for a handful of my users.

All of the many posts related to this issue seem to be at least 5 years old, but I am having the problem now.

Are you only seeing this issue in iOS 15? It could be a regression, and you should file this on Feedback Assistant.

Thanks so much for your quick reply. I have been able to isolate the problem and it turns out to be the programmer (aka me).

UserDefaults getting erased on Simulator, some Devices
 
 
Q