nsubiquitouskeyvaluestore

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

天大地大妈咪最大 提交于 2019-12-21 04:25:20
问题 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

NSUbiquitousKeyValueStore sync issues

馋奶兔 提交于 2019-12-09 06:33:27
问题 I'm having nothing but trouble with NSUbiquitousKeyValueStore and getting it to reliably sync across two devices. It's starting to drive me mad. Mad. I watch my code make a call to: [[NSUbiquitousKeyValueStore defaultStore] setObject:_someData forKey:@"SomeData"]; [[NSUbiquitousKeyValueStore defaultStore] synchronize]; But more times than not, the data never shows up on the other device. I've seen it sync within a few seconds and other times I've waited for an hour and never seen a sync. I

How to use NSUbiquitousKeyValueStore and NSUserDefaults together

丶灬走出姿态 提交于 2019-12-04 00:53:51
问题 Documentation is not clear on how to use NSUbiquitousKeyValueStore with edge cases. If I want to set a value, I understand that I should set a value to both NSUserDefaults and NSUbiquitousKeyValueStore since iCloud could be disabled. However in my tests [NSUbiquitousKeyValueStore defaultStore] return a valid object even if iCloud is disabled (tested on Mac OS). Also, to my understanding is that if iCloud is enabled, NSUbiquitousKeyValueStore 's values are stored to disk (and available offline

NSUbiquitousKeyValueStore sync issues

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-03 07:59:25
I'm having nothing but trouble with NSUbiquitousKeyValueStore and getting it to reliably sync across two devices. It's starting to drive me mad. Mad. I watch my code make a call to: [[NSUbiquitousKeyValueStore defaultStore] setObject:_someData forKey:@"SomeData"]; [[NSUbiquitousKeyValueStore defaultStore] synchronize]; But more times than not, the data never shows up on the other device. I've seen it sync within a few seconds and other times I've waited for an hour and never seen a sync. I plug the devices into xcode and start debugging and sometimes the data suddenly pops up and other times

How to use NSUbiquitousKeyValueStore and NSUserDefaults together

微笑、不失礼 提交于 2019-12-01 03:55:42
Documentation is not clear on how to use NSUbiquitousKeyValueStore with edge cases. If I want to set a value, I understand that I should set a value to both NSUserDefaults and NSUbiquitousKeyValueStore since iCloud could be disabled. However in my tests [NSUbiquitousKeyValueStore defaultStore] return a valid object even if iCloud is disabled (tested on Mac OS). Also, to my understanding is that if iCloud is enabled, NSUbiquitousKeyValueStore 's values are stored to disk (and available offline). What are the reason to use NSUserDefaults if you are sure that you have less than 64KB of data? I am

iCloud NSUbiquitousKeyValueStore initial sync/access delay - how to handle?

☆樱花仙子☆ 提交于 2019-11-30 13:19:58
问题 I'm using NSUbiquitousKeyValueStore to store some app settings. My logic is: when I save data locally, I save it to NSUbiquitousKeyValueStore also as a backup. When I need settings, I read locally and I only use iCloud key-value store if no data is found locally (after app is reinstalled, for example). If user has several devices sharing one icloud id, he can write settings on one device and download them to another (I warn him about rewrite). I have a strange issue. Steps: Installed an app

iCloud NSUbiquitousKeyValueStore initial sync/access delay - how to handle?

ⅰ亾dé卋堺 提交于 2019-11-30 06:52:53
I'm using NSUbiquitousKeyValueStore to store some app settings. My logic is: when I save data locally, I save it to NSUbiquitousKeyValueStore also as a backup. When I need settings, I read locally and I only use iCloud key-value store if no data is found locally (after app is reinstalled, for example). If user has several devices sharing one icloud id, he can write settings on one device and download them to another (I warn him about rewrite). I have a strange issue. Steps: Installed an app and save its data to NSUbiquitousKeyValueStore. Made sure data is there. Removed the app (assuming data

How to programmatically detect if the iCloud is enabled on user's device when only use NSUbiquitousKeyValueStore?

狂风中的少年 提交于 2019-11-29 12:06:12
问题 I am using NSUbiquitousKeyValueStore to sync some preference data to iCloud. I found that if the user disable "Document & Data" item of iCloud in "Setting App", NSUbiquitousKeyValueStore can not synchronize its data to iCloud. So, I want to first check if this setting is switched on. I found this Code snippet: NSURL *ubiq = [[NSFileManager defaultManager] URLForUbiquityContainerIdentifier:nil]; NSLog(@"url=%@",ubiq); if (!ubiq) { UIAlertView *av = [[UIAlertView alloc] initWithTitle:nil

NSUbiquitousKeyValueStore error: no valid com.apple.developer.ubiquity-kvstore-identifier entitlement

孤街浪徒 提交于 2019-11-27 05:56:30
问题 I'm having a problem integrating iCloud with my app. When I set test out iCloud availability, I receive Success for the function NSURL *iCloudURL = [fileManager URLForUbiquityContainerIdentifier:@"AppID"]; but right after this, when I attempt to perform: NSUbiquitousKeyValueStore *iCloudStore = [NSUbiquitousKeyValueStore defaultStore]; I receive the error NSUbiquitousKeyValueStore error: no valid com.apple.developer.ubiquity-kvstore-identifier entitlement. Any ideas on how to fix this? My App