1

In my iOS app, I store strings in NSUserDefaults without a synchronize after it. Now I'm facing bugs where this string seems not to be persisted sometimes - what could be the reasons for this?

I know/hope, that calling synchronize afterwards fixes the issue but I would love to understand what may cause the problem, e.g. when the app goes to the background? I'm pretty sure the user does NOT force kill the app. Data Protection is turned off in the app, so what else may be the reason for this?

A user having this problem is using a non-jailbroken iPhone 8 Plus with iOS 11.2.5 installed.

swalkner
  • 16,679
  • 31
  • 123
  • 210
  • this will help you https://stackoverflow.com/questions/9647931/nsuserdefaults-synchronize-method – Rocky Feb 20 '18 at 07:44
  • hm... not really - it does not really state if and when it's possible that userdefaults are not written – swalkner Feb 20 '18 at 14:52

0 Answers0