iOS 9.3.1 NSUserDefaults Wiped Bug?

Ive now had a few apps where the NSUserDefaults has seemed to be wiped, making the app think its never been used before. This has happened in WhatsApp & in my own app. With WhatsApp I had to go through the whole setup process again & restore my chat backup. Has anyone else had this problem?

Replies

I am experiencing the same problem with app distributed through TestFlight. After updating from 9.3 to 9.3.1 NSUserDefaults were wiped.

Yeah it's extremely annoying, also happening to Facebook too. I'm going to perorm a full restore and see if that helps, I've also opened a bug report with Apple.

I've now tried restoring, didn't work... What's app & Facebook apps wipes daily along with my app in development. Still trying to figure at what point they get wiped as I'm able to use the app a fews times fine. Anyone have any suggestions?

I'm seeing this in 9.3 and 9.3.1. Are you seeing this in first party apps as well?

I'm seeing this as well, though it looks like the UserDefaults is not wiped, it only looks like the settings are not loaded in time. If I abort the execution of the App (and make sure the user defaults are not modified or saved) and launch the App another time, the settings are usually available again. So I assume that NSUserDefaults is internally loading the settings too late, or does not wait until the settings have finished loading.

I'm also experiencing this, had it happen today with WhatsApp and Hangouts. Pretty bad bug!

I'm seeing this bug as well.

It happens with Facebook, LINE, LINE@, SmartNews, and of course with my own apps.

These apps force me to login almost everyday, after I updated iOS from 9.2.1 to 9.3.1.

And in my own app, I checked all data stored in NSUserDefaults.standardUserDefaults() was deleted.

The data doesn't seem to be gone forever, and when it's broken they load in around 1 in 5 times. The rest of the time it just loads in some kind of blank defaults.


It's especially nasty when it happens to Whatsapp as they treat the device as a new phone and you lose chat history 😟

Yes. It seems that the iOS just "forgets" to load the data sometimes. If this happens in my own App while debugging, I can easily kill the App and prevent that it will change the userdefaults, and the next time I lanuch it again, the settings are usually loaded just fine. The big problem is that when you are not debugging your own Apps, you do not have a chance to kill an App before it save any settings, and when an App does this, the old settings are overwritten and lost forever.

Also facing the same issue since 9.3, and now it persists on 9.3.2.

I've had this issue happen with a first party app as well - Weather. It lost all the saved cities, about one month ago.

Whatsapp is by far the worst in terms of data loss. You can't avoid some of it even if you're obsessively backing it up to iCloud every single time you use the app.

I know of one person which is not using the iPhone as a development device and is also having the same problem, so this NSUserDefaults issue is probably not related to that.

Which iPhone models are you seeing the issue on? Mine is a 5S.


I've submitted a bug report to Apple.

I've been seeing this as well but figured out a workaround for my own apps: If my keys aren't found, call resetStandardUserDefaults and try again. It shouldn't hurt to repeat that a few times before bailing and assuming it's a first-run, but so far it has always worked after the first reset.

Is there any news about this issue ? I'm experiencing the problem with my apps, I don't know if I should do the workaround or wait for Apple to fix his OS.

I am just getting around to this bug. I guess I am not alone.

calling NSUserDefaults resetStandardUserDefaults had no effect for me

This has been happening to me for the last few months. By FAR, the most distressing bug I've encountered on iOS as a user. Can't use What's App, as I'm constantly losing chat history. Have to log in again to Evernote, Instagram. Settings and tips for many apps reset and I'm sent back to onboarding screens.


For the first time, I've lost all trust in my iPhone. A thought of getting a "reliable" Android phone crossed my mind...


I hope this is getting fixed, soon.