Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it safe to rely on NSUbiquitousKeyValueStore for storing essential data?

I learned that NSUbiquitousKeyValueStore is always available, also when no iCloud account is set up. This makes me believe I can safely store essential data in it, without keeping a copy in NSUserDefaults.

However, in their documentation, Apple says the following:

Avoid using this class for data that is essential to your app’s behavior when offline; instead, store such data directly into the local user defaults database.

Do I overlook issues that might arise when not using NSUserDefaults (or another offline store) as back-up? Or is Apple being overprotective and is it safe to rely on NSUbiquitousKeyValueStore?

like image 406
Jonathan Avatar asked May 14 '14 18:05

Jonathan


1 Answers

Julien commented the following about this question:

What this means is that you should not rely on this store to be your local truth but more of a simple sync communication channel between your devices.

like image 61
Jonathan Avatar answered Nov 15 '22 00:11

Jonathan