LoginSignup
94

More than 5 years have passed since last update.

アプリを約250個以上起動するとUser Defaultsが読み込めなくなる問題について

Last updated at Posted at 2017-06-23

最近iOSで発生していた、突然NSUserDefaultsの内容が消えてしまう問題について、Appleから公式にアナウンスがありました。

NSUserDefaults Data Loss Fix

Starting in iOS 9.3, and in subsequent releases of iOS and macOS, NSUserDefaults could fail to load data if more than roughly 250 separate apps (including separate reinstalls of the same app) had been launched since the last reboot. This has been corrected.

原因はiOS9.3以降のiOSで、デバイスを起動してからアプリの再インストールを含めて約250アプリを起動することで、
UserDefaultsのデータの読み込みに失敗するとのことです。

iOS11でこの問題が修正されたと案内されていますが、iOS9.3だけでなくiOS10にも影響があるということで、しばらくは尾を引きそうな問題となっています。
現状では回避が不可能に思われるので、User Defaultのロードに失敗した際のケアをしっかりする必要がありそうです。

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
94